Lines with only spaces are removed, even in code blocks #1884
Labels
L1 - broken
Valid usage causes incorrect output OR a crash AND there is no known workaround for the issue
released
Describe the bug
Spaces are removed from lines with only spaces. Though this might make some kind of sense for normal markdown, in code blocks it could be a problem in some esoteric programming languages such as whitespace but, perhaps more importantly, in real-time editing situations which is how it effects my use case.
To Reproduce
Marked Demo (Issue)
CommonMark Demo (Works as anticipated)
This caught me off guard because when I tried to fix it by extending the marked tokenizer, I found that the spaces were removed even there!
The problem is the first line of the lexer
blockTokens
function:marked/src/Lexer.js
Line 123 in c8783a3
In my project I was forced to override the whole
blockTokens
function removing the first line. What would be the repercussions of removing it in general? Alternatively this could be an option..Thanks for the great library!
The text was updated successfully, but these errors were encountered: