commonmark-java icon indicating copy to clipboard operation
commonmark-java copied to clipboard

ThematicBreak literal is lost in the Markdown renderer

Open jumale opened this issue 7 months ago • 1 comments

Corresponding to the specification, thematic breaks can consist of 3 or more consecutive on of characters -, _ or * with 0-3 leading spaces (i.e. regex ^\s{0,3}[-_*]{3,}$). This logic seem to be correct when reading Markdown - the thematic breaks are correctly recognised and captured as ThematicBreak node with literal parameter containing the actual value from the Markdown. However, during rendering the literal is dropped and replaced with static ___

Expected behaviour: this markdown looks the same after parse/render

foo

   *******

bar

---

baz

Actual behaviour: rendered transforms it into

foo

___

bar

___

baz

jumale avatar Jul 01 '24 07:07 jumale