vim-pandoc / vim-pandoc-syntax

pandoc markdown syntax, to be installed alongside vim-pandoc
MIT License
425 stars 61 forks source link

Double $$ breaks syntax without whitespaces #347

Closed elshize closed 2 years ago

elshize commented 3 years ago

I know there are several open issues regarding $ but I didn't see this particular one mentioned.

Context

The issue relates to what Pandoc documentation calls display math:

For display math, use $$ delimiters. (In this case, the delimiters may be separated from the formula by whitespace.)

Problem

If the equation is separated from both sides by newlines, then the syntax works just fine:

image

However, if the newline is gone on either side (or both), then the syntax for the rest of the file breaks (note no bold font; other things are broken, too):

image

Note that it must be newlines, e.g., spaces around the equation don't fix it.

Workaround

Clearly, the workaround is to simply place $$ in separate lines, so it's not that big of a deal. But since the pandoc docs say it "may" be separated, and there's no mention of newlines, it could break some markdown documents that already exist. Plus, it wasn't clear to me why my syntax broke for a while until I noticed what was going on.

user202729 commented 2 years ago

It appears that the bug is fixed now.

elshize commented 2 years ago

@user202729 thanks for letting me know. It seems to work correctly for me now, too. I'll close this issue then.