microsoft / vscode-markdown-it-katex

Add Math to your Markdown with a KaTeX plugin for Markdown-it
Other
22 stars 17 forks source link

List continuation is broken after a display equation that follows single line break `\n$$x^2$$` breaks lists. #3

Open universemaster opened 2 years ago

universemaster commented 2 years ago

If we write a display equation in a list without a line break before then lists continue below, correctly, without restarting numbering.

However, if adding a single line break \n in markdown source before the display equation then lists break and restart numbering below.

Correct (desired) behaviour is observed in markdown-it-texmath and Markdown Preview Enhanced.

A workaround is to use a 4 space indent, but this often breaks syntax highlighting when used with markdown-it-definition-list and is a pain to have to refactor my markdown.

Some example text is available here (without the definition lists).

Test markdown source