shuzijun / markdown-editor

IntelliJ Platform A full-featured WYSIWYG editor for markdown
https://plugins.jetbrains.com/plugin/17254-markdown-editor
Apache License 2.0
155 stars 35 forks source link

Markdown Editor incorrectly inserts blank line to Latex block #81

Closed winston-zillow closed 1 year ago

winston-zillow commented 1 year ago

Open a markdown document in the IDE's built-in markdown editor, insert a standalone latex markup block, like

$$
s_i = P(V | z_i) = f_s(z_i; \theta^{s})
$$

Go to the Markdown Editor tab, notice the math formula is rendered.

Go back to the IDE's editor tab, notice that a newline has been inserted at the closing $$:

$$
s_i = P(V | z_i) = f_s(z_i; \theta^{s})

$$

This will cause tools like pandoc to error when seeing the block:

Error producing PDF.
! Missing $ inserted.
<inserted text> 
                $
l.439 ...P(V\textbar z\_i) = f\_\{s\}(z\_i; \theta

Removing the extra newline, the rendering works again.

Screenshot before:

Screen Shot 2022-12-22 at 12 16 59 PM

Screenshot after:

Screen Shot 2022-12-22 at 12 17 36 PM