-
-
Notifications
You must be signed in to change notification settings - Fork 275
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
Inconsistent hard line break behavior in GFM (GitHub Flavored Markdown) parser #82
Comments
Actually, Github uses both, hard line breaks and the normal Markdown behaviour. Whereas in other parts (e.g. conversion of Maybe an option to turn off hard line breaks in GFM would be useful? |
I based myself on the documentation at https://help.github.com/articles/github-flavored-markdown But since it's apparently not consitently used everywhere I agree a switch would be useful. |
Good call guys. I've opened a basic pull materializing this idea at #83. Thanks. |
I would say take the documented behavior as default. That way if people are
|
@gettalong @plexus Thanks for taking a look guys. I was originally trying to make the interface look like Redcarpet's, where a flag has to be set for hard wrapping to come into effect. +1 on making it the documented default though, if only so that the behavior for existing users doesn't change under them. I've updated my pull to toggle the default. Slightly unrelated, I added another set of tests, but was slightly surprised when they didn't fail because nothing written in Ruby ever works on the first try. Am I doing it right? |
Thanks @brandur for the pull request. I have merged your code now. |
I was perusing Kramdown's GFM (GitHub Flavored Markdown) parser, and came across one area that was slightly surprising. It seems that it automatically adds hard line breaks to Markdown it parses (see https://github.com/gettalong/kramdown/blob/master/lib/kramdown/parser/gfm.rb#L17-L20):
This is conspicuously different from Redcarpet's default behavior in this area (which I believe is the closest thing to a GFM reference parser as we have), from Kramdown's documented behavior there too (which is only to insert a hard break only on two spaces or two backslashes at the end of a line), and even from GitHub's behavior while editing Markdown documents in-browser (see this Gist for reference):
Is there a reason that it behaves this way? Can I send a pull to change it or put it in an option?
/cc @plexus
The text was updated successfully, but these errors were encountered: