Bug or expected? Markdown sometimes doesn't work inside `div` tags

There seem to be certain weird edgecases in which markdown doesn’t work inside HTML tags.

Is this a bug or an expected behavior? If it is expected, then what is the reason behind it?

Demo: commonmark.js demo

Source:

This, <div>**Works** as expected</div>

-- --

So does

<span>**this**</span>

-- --

But 

<div style="color: red">**this does not!** <== Bug!</div>
1 Like

This looks like a bug, but unrelated to the style attribute. Using a non-span tag such as div or p when the tag starts a new line causes the problem.

x <p>**this appears as bold text**</p>

<p>**this does not appear as bold text**</p>
1 Like

What’s the procedure to getting this fixed in the future specs? I’m new to these forums. Thanks :slight_smile:

We ask @jgm, the author of the spec, if the behaviour is intentional or a bug. It appears to relate to whether the HTML tag is a block level tag or phrasing content (and some tags can be both).

Related discussion: