-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gfm style line breaks break html badly #115
Comments
I changed the inline.breaks = merge({}, inline.gfm, {
br: replace(inline.br)('{2,}', '+')(),
text: replace(inline.gfm.text)('{2,}', '+')()
}); to remove the unnecessary |
+1 -- very serious issue if you want to include some readable HTML. |
is the change proposed by @chemzqm a viable fix for this? any chance of it being merged in? |
The correct behavior (where correct means "works most of the time and matches what github actually does") is to toss the current line breaks implementation and make it so that newline-to-br processing happen with a simple find and replace only in the 'paragraph' and 'text' cases in the big Parser.prototype.tok switch. |
Submitted a pull request #348. It doesn't feel like it matches the style/organization exactly, but it does the right thing. |
With gfm line breaks enabled, code like this:
Will generate
<br>
tags at the end of each line, which creates invalid HTML and ugly rendering as the browser moves those extra line breaks somewhere.github's actual github flavored markdown doesn't appear to have this unfortunate behavior.
The text was updated successfully, but these errors were encountered: