Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Disable hard wrapping in GFM #2864

wants to merge 1 commit into from

6 participants


This is a follow-up to #2818 that disables the hard wrapping entirely with no config option.


I don't think this is gonna be merged. I think most people are happy with hard_wrap and also is it compliant to Github's parsing (well beside from HTML for some reason). Also this will break existing files and comments. Especially the latter is a part where I would expect hard wrapping.

Did you thought about maintaining a personal branch where you can cherry pick and manage your own personal changes (I removed the HTML restriction for example).

Github doesn't use hard wrap.


we keep current implementation for compatibility. thank you

@mikkyhouse mikkyhouse closed this

@titanous Perfect, this is awesome. Creating paragraph breaks from newlines is totally wrong, especially for Git commit messages which should be hard wrapped at 72 columns, but you would want this reflowed by a rendered rich text view.


This change should be merged. Writing a paragraph on a single line is painful and forcing a paragraph break at newline is just wrong. GitHub does not treat newlines in this way.


What if someone makes a pull request that adds a config option to make the GitLab-flavor the default but the user can opt-in to the standard markdown line break treatment by setting a config file option? Perhaps that will be acceptable since it won't break backward compatibility.


Having to either write crazy long lines of text (or worse turn on wrapping in a text editor), or have non-sensical paragraph structure in markdown files is ridiculous.

Having at least a "sane documentation option" would be quite useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 31, 2013
  1. @titanous

    Disable hard wrapping in GFM

    titanous authored
This page is out of date. Refresh to see the latest.
3  app/helpers/gitlab_markdown_helper.rb
@@ -33,8 +33,7 @@ def markdown(text)
gitlab_renderer =,
# see
filter_html: true,
- with_toc_data: true,
- hard_wrap: true)
+ with_toc_data: true)
@markdown =,
# see
no_intra_emphasis: true,
13 app/views/help/markdown.html.haml
@@ -29,19 +29,6 @@
%h3 Differences from traditional Markdown
- %h4 Newlines
- %p
- The biggest difference that GFM introduces is in the handling of linebreaks.
- With traditional Markdown you can hard wrap paragraphs of text and they will be combined into a single paragraph. We find this to be the cause of a huge number of unintentional formatting errors.
- GFM treats newlines in paragraph-like content as real line breaks, which is probably what you intended.
- %p The next paragraph contains two phrases separated by a single newline character:
- %pre= "Roses are red\nViolets are blue"
- %p becomes
- = markdown "Roses are red\nViolets are blue"
%h4 Multiple underscores in words
Something went wrong with that request. Please try again.