cmark icon indicating copy to clipboard operation
cmark copied to clipboard

Issue with rendering whitespace to commonmark

Open bbelay-ptc opened this issue 1 year ago • 1 comments

There is an issue with cmark_render_commonmark function when it gets as an input a document that has a text node with a whitespace in the beginning, it does not return a correct markdown string.

For example, the following document:
Document node -> Paragraph node -> Text node with text literal
is rendered as text\n, which is a code block.

From looking at some other implementation I see the whitespace is replaced with  . Can this applied in cmark? thanks

bbelay-ptc avatar Nov 13 '24 12:11 bbelay-ptc

Another option would be to simply trim the initial whitespace.

jgm avatar Mar 25 '25 04:03 jgm