Vscode-markdown: Markdown TOC is generated incorrectly when `#` appears in a code block.

Created on 15 Oct 2018  ยท  7Comments  ยท  Source: yzhang-gh/vscode-markdown

What is the problem?

Table of contents is generated incorrectly when I comment a line in a code block.

Such as:

# I commented this line.
echo 'The line above is commented.'

When I have a block of code similar to above in a Markdown file, the TOC auto-generation-tool thinks the line I commented is a header and tries to put it in the TOC as a independent title.

How can I reproduce it?

When I have such code block in a Markdown file.

Below is yet another example.

img

๐Ÿ‘† The TOC auto generated.

img

๐Ÿ‘† The original Markdown snippet.

Is there any error message in the console?

As far as I see, it's not an error, it's a design problem.

table of contents Bug Fixed

Most helpful comment

You can download the dev build here ๐Ÿ˜Ž.

All 7 comments

Good catch. This is fixed in the latest dev build.

More information

๏ผˆๅฆๅค–ๆƒณ้—ฎไธ‹ไฝ ๆˆชๅ›พ้‡Œ็š„ๅญ—ๆ˜ฏ็”จ็ฌ”ๅœจ่งฆๅฑไธŠๅ†™็š„ๅ—๐Ÿ˜‚๏ผŒๆœ‰ๆ„ๆ€๏ผ‰

@neilsustc Cool, that's good to know. Looking forward to your next update.๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰
๏ผˆๆ˜ฏ็š„ๅ“ˆๅ“ˆๅ“ˆๅ“ˆๅ“ˆๅ“ˆๅ“ˆๅ“ˆๅ“ˆๅ“ˆๅ“ˆ๏ผŒThinkPad X1 Yoga ๐Ÿ’ป๏ผ‰

You can download the dev build here ๐Ÿ˜Ž.

Hey @neilsustc how long until it rolls into the normal distro?

Actually, I have been waiting for the stable version of KaTeX (an upstream module) for two months ๐Ÿ˜‚

image


Anyway, I will release a new version this weekend.

Sweet, thanks @neilsustc! I tested the dev build and verified it fixes my issue as well.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

smallprogram picture smallprogram  ยท  3Comments

chuyangliu picture chuyangliu  ยท  5Comments

MisterY picture MisterY  ยท  3Comments

deanishe picture deanishe  ยท  4Comments

gurbindersingh picture gurbindersingh  ยท  4Comments