I've looked for an option but I don't see one. When I process my strings/messages, if the original has multiple newlines in a row, they are replaced with a single newline.
I would like to preserve those newlines outside of markdown. Is this intended? Is there a way to get around it? Glad to submit a PR if this could be added as a feature or flag...
In this regard markdown is like LaTeX, multiple whitespace is crushed into a single one. It just isn't in the philosophy of markdown to allow arbitrary whitespace.
@Feder1co5oave that's what I figured. I'd like to propose adding a feature to the marked lib that allows you to preserve whitespaces. I could always fork and use my own repo but I figure others might benefit from it as well. Thoughts?
Whether whitespace is compressed into a single new line should be the choice of the developer.
I do think it would be a nice option. I'm open to make the changes if pointed in the right direction.
@phutchins One way to do this would be to create a new token of type: break in Lexer.prototype.token. Modify the current line break regex to parse to add these custom break tokens to this.tokens. From there just add this new break token to the switch statement in Parser.prototype.tok. I made this change in my local version and it works perfectly.
Although, I doubt @Feder1co5oave would be willing to merge such changes.
Closing for now as expected behavior based on the supports specs. See #956
Most helpful comment
@Feder1co5oave that's what I figured. I'd like to propose adding a feature to the marked lib that allows you to preserve whitespaces. I could always fork and use my own repo but I figure others might benefit from it as well. Thoughts?