atom-community / markdown-preview-plus

Markdown Preview + Community Features
https://atom.io/packages/markdown-preview-plus
Other
370 stars 84 forks source link

Block math seems to break a list #473

Closed AstrickHarren closed 4 years ago

AstrickHarren commented 4 years ago

I was trying to write a list of math theorems but the displayed math seem to break a list in the middle: if I write

1. This is an equation
    $$2x + 3$$
and this line is not in the list. 

It looks something like this:

Screen Shot 2019-11-02 at 9 20 37 PM

This happens both if I use SVG or HTML-CSS rendering.

lierdakil commented 4 years ago

This is expected. Well, kind of. Math parsing with markdown-it is a bit of a hack, and display math is treated as a block-level element. Hence, the and this line is not in the list is not a lazy paragraph continuation, but a paragraph in itself. Hence, if you want it to be in the list, you have to indent it by 4 spaces, i.e.

1. This is an equation
    $$2x + 3$$
    and this line is now in the list. 

P.S. Sorry for the late response, I was out of town.

AstrickHarren commented 4 years ago

Thanks, problem solved. This package really saves a lot of time writing casual math 👍