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:


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


However, in the CommonMark dingus, it renders as:


The matter is further complicated by tweaking the example slightly:


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:


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?