Nested inline styles - differences in implementations

I’ve encountered an instance of nested inline styling that seems to be handled quite differently across implementations. It’s an edge case, so I’m not sure whether it’s a gap in the spec or an issue with implementation.

Consider the following CommonMark text:

**bold*****bold+italic*****bold**

In GitHub authored implementations (cmark and comrak), this renders as follows:

boldbold+italicbold

However, in the CommonMark dingus, it renders as:

boldbold+italic****bold

The matter is further complicated by tweaking the example slightly:

**bold*****bold+italic****italic*

This case doesn’t seem to render per spec in any of the implementations I’ve tried. Here’s how it looks on GitHub parsers:

boldbold+italic**italic

I’m inclined to think that the rendering of the latter example is due to at gap in the parsing implementation. If I’m not mistaken, the spec dictates that that it should have rendered as follows, correct?

boldbold+italicitalic

1 Like