Open SwissArmyWrench opened 1 year ago
Same issue here! While GitHub markdown does add the lines correctly. Quite an annoyance! Is it an issue within marktext or some external library that is used?
It seems that
\n
before every 'text'
token, but not in between text tokensIn the lexer a paragraph is seen here:
https://github.com/marktext/marktext/blob/4fef4498b57a283aad6c6ced2cad3003a7d3bc49/src/muya/lib/parser/marked/lexer.js#L531-L534
And here is also the place where \n
is replaced with an empty string. So this is probably where the cause is: the multiple lines are seen as a single paragraph, and thus the \n
are removed.
There is an option right above the line, which is 'disableInline', however, as I see it, it is not and cannot be passed to the exportHtml function here https://github.com/marktext/marktext/blob/4fef4498b57a283aad6c6ced2cad3003a7d3bc49/src/muya/lib/utils/exportHtml.js#L133
So, in short, this would require an additional option setting to set disableInline
option to the renderer?
Description
Line breaks that are not paragraph breaks are ignored when exporting as PDF/HTML.
Steps to reproduce
Expected behavior: One would expect the line breaks to be rendered in the PDF/HTML export the same was as they are shown in Marktext.
Actual behavior: The line breaks have been ignored and the text runs together as if it was only separated by spaces, breaking whatever formatting you had in your original Markdown file.
Versions