# Mixing punctuation, markup and word-islands

**URL:** <https://talk.commonmark.org/t/mixing-punctuation-markup-and-word-islands/3972>\
**Category:** Spec\
**Created:** [September 8, 2021, 10:00pm UTC](https://talk.commonmark.org/t/mixing-punctuation-markup-and-word-islands/3972 "2021-09-08T22:00:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Erquint](https://talk.commonmark.org/user_avatar/talk.commonmark.org/erquint/32/2321_2.png) [@Erquint](https://talk.commonmark.org/u/Erquint)\
**Post date:** [September 8, 2021, 10:00pm UTC](https://talk.commonmark.org/t/mixing-punctuation-markup-and-word-islands/3972/1 "2021-09-08T22:00:53Z")

</div>

```auto
  **Non-** essential+expenditures.

```

[BabelMark 2 test](https://johnmacfarlane.net/babelmark2/?text= **Non-** essential+expenditures.):

CommonMark & co.:

> ```html
> <p> **Non-** essential expenditures.</p>
> 
> ```
> 
> \*\*Non-\*\*essential expenditures.

The rest:

> ```html
> <p><strong>Non-</strong>essential expenditures.</p>
> 
> ```
> 
> **Non-** essential expenditures.

* * *

Is this acceptable? Are we cool with this? Works as intended?

If so, what are the sane workarounds?  
Can’t really escape punctuation.  
HTML is a hack too dirty for this simple case.  
Not looking for something overly verbose either.  
Moving punctuation past the tag helps but doesn’t count, since that naturally produces different output for all engines.

---

<div class="post-metadata">

**Author:** ![jgm](https://talk.commonmark.org/user_avatar/talk.commonmark.org/jgm/32/1360_2.png) [@jgm](https://talk.commonmark.org/u/jgm)\
**Post date:** [September 8, 2021, 10:33pm UTC](https://talk.commonmark.org/t/mixing-punctuation-markup-and-word-islands/3972/2 "2021-09-08T22:33:32Z")

</div>

It does work as advertised, since the ` **` in `-** e` is  
left-flanking and not right-flanking. Granted, it’s not  
what one might want, but keep in mind that the rules for emphasis  
have to cover a very wide variety of cases, and lots of thought  
has been put into getting as many as possible “intuitively  
right.”

Here is an ugly workaround:

**Non-** essential

Another workaround would be to insert a unicode zero-width space  
(U+200B) between the `-` and the `**`.

---

<div class="post-metadata">

**Author:** ![Erquint](https://talk.commonmark.org/user_avatar/talk.commonmark.org/erquint/32/2321_2.png) [@Erquint](https://talk.commonmark.org/u/Erquint)\
**Post date:** [September 10, 2021, 1:24am UTC](https://talk.commonmark.org/t/mixing-punctuation-markup-and-word-islands/3972/3 "2021-09-10T01:24:10Z")

</div>

Can’t tell if that’s one workaround you showcased there or two.  
Can’t seem to be able to inspect source of the messages here on Discourse.

And since I’m new to both Discourse and CommonMark, I also couldn’t figure out why syntax highlighting wouldn’t work for those HTML codeblocks despite specifying the language in info string.

It highlights if I add `<pre>` tags to the code, which then also get printed:

```HTML
<pre><p><strong>Non-</strong>essential expenditures.</p></pre>

```

Or if I mangle it with some other additions/replacements:

```HTML
:
<p><strong>Non-</strong>essential expenditures.</p>

```

```HTML
<p:><strong>Non-</strong>essential expenditures.</p>

```

```HTML
<c><strong>Non-</strong>essential expenditures.</p>

```

But won’t otherwise in a normal way.

---

<div class="post-metadata">

**Author:** ![jgm](https://talk.commonmark.org/user_avatar/talk.commonmark.org/jgm/32/1360_2.png) [@jgm](https://talk.commonmark.org/u/jgm)\
**Post date:** [September 10, 2021, 6:04pm UTC](https://talk.commonmark.org/t/mixing-punctuation-markup-and-word-islands/3972/4 "2021-09-10T18:04:01Z")

</div>

Sorry, I am using email for this and I forgot that it interprets markdown.  
Here are the two workarouds:

1. ` **Non-** &#101;ssential`

2. Insert a unicode zero-width space U+200B between `-` and `**`

---

<div class="post-metadata">

**Author:** ![Erquint](https://talk.commonmark.org/user_avatar/talk.commonmark.org/erquint/32/2321_2.png) [@Erquint](https://talk.commonmark.org/u/Erquint)\
**Post date:** [September 20, 2021, 6:14pm UTC](https://talk.commonmark.org/t/mixing-punctuation-markup-and-word-islands/3972/5 "2021-09-20T18:14:35Z")

</div>

I see now.

Quite disappointing this won’t get fixed for normal usage. 😔
