Force GitHub to require two linebreaks for Markdown line breaks

Apparently GitHub switched to use a single line break for rendering </br> in the Markdown rendering.

Please don’t. This breaks all my MarkDown files when they are rendered. This change apparently affected GitHub issues and other places.

If possible, please provide a config to retain the behavior and original Markdown rules.

You mean in repositories documentation? What you describe used to apply only to Issues, not to repositories or Wikis markdown previews. I didn’t notice this change taking effect, and I use one-sentence-per-line splitting in my markdown docs, so they should be all visibly breaking up if this happened.

I’ve just checked a repository of mine with a README.md where I split paragraphs at the end of each sentence, but in the preview there are no newlines, it’s a whole paragraph as usual.

@ericoporto, I’ve looked up the GitHub Flavored Markdown Spec, and noticed that in §6.12. Hard line breaks it mentions:

A line break (not in a code span or HTML tag) that is preceded by two or more spaces and does not occur at the end of a block is parsed as a hard line break (rendered in HTML as a <br /> tag):

Any chance that there are trailing spaces in the documents in which you noticed hardline-breaks appearing? (maybe they were accidentally added with new commits).

To avoid these problems, I always add .editorconfig settings to my repositories, so that my editor will pick up the code consistency rules via an EditorConfig plugin, and also use it for code validation on each commit/PR via Travis CI.

In this repository you can find a sample .editorconfig settings file, a validation script and the Travis CI settings I sue to ensure that all code is clean in submitted contents:

These are the markdown settings I use in my .editorconfig, which will prevent trailing spaces at line ends (which I never use):

## Markdown GFM
###############
[*.md]
indent_style = space
indent_size = unset
end_of_line = unset
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true