Mixing punctuation, markup and word-islands


BabelMark 2 test:

CommonMark & co.:

<p>**Non-**essential expenditures.</p>

**Non-**essential expenditures.

The rest:

<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.

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

Here is an ugly workaround:


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

1 Like

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:

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

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

<p><strong>Non-</strong>essential expenditures.</p>
<p:><strong>Non-</strong>essential expenditures.</p>
<c><strong>Non-</strong>essential expenditures.</p>

But won’t otherwise in a normal way.

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 **

I see now.

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