markdown-to-jsx icon indicating copy to clipboard operation
markdown-to-jsx copied to clipboard

Falsy rendering code block in a code block

Open AmayaKuro opened this issue 8 months ago • 1 comments

Description

When rendering a code block with language, it will ignore (```) that has no character between them. Ex:

Markdown:

image

Display:

image

We can see that (```)markdown will catch nearest (```) but ignore (```)python since nothing is in between them.


Now for code block which has language but does has character in between them:

Markdown:

image

Display:

image

If it has only a character between (```)s , it will still group everything although the second (```) is mean for other code block

Ideas

Like other markdown renderer (e.g. the one used by Github and VSCode), a code block should only catch standalone (```), instead of the next (```) even if they suppose to be used by other block.

AmayaKuro avatar Nov 24 '23 07:11 AmayaKuro

The second set of ``` terminates the prior, you need to escape the inside ones. Thinking about if there's a good way to handle this. When there is a language specified it makes it easier since you know for sure that it's basically a new "opening" but without a language it's ambiguous.

quantizor avatar Mar 13 '24 19:03 quantizor