naomi icon indicating copy to clipboard operation
naomi copied to clipboard

Markdown code block with syntax specified breaks following text

Open YuriGor opened this issue 5 years ago • 2 comments

Anonymous code blocks works fine, but code blocks with syntax js or javascript make following text after code scoped as a string.

image

here is a text sample: https://gist.github.com/YuriGor/acb356c1803b0ea75ebeb865d48f28ef

YuriGor avatar Oct 25 '18 07:10 YuriGor

Confirmed. Just ran into this myself. Quite annoying. 😕

Thought first it was related to the ` being a string literal thing in javascript, which it probably is, but semi-colons seem to somehow mess with it too:

1 2

Svish avatar Apr 05 '19 10:04 Svish

Interesting because this is the opposite problem that other markdown syntax highlighters have, where any "invalid" syntax (e.g. NOT ending a line with a semicolon) will break highlighting for the rest of the markdown.

I doubly ran into this issue because I use JsPrettier to auto-format my files on save, and it was adding a semicolon to the end of my JS blocks. 😂

If anyone else is having that issue, you can tell JsPrettier to ignore markdown files, but you can also add <!-- prettier-ignore --> right above the code block, which is what I opted for until this bug can be fixed.

acnebs avatar Jun 17 '19 16:06 acnebs