by jorams · 9y ago · 0 comments
CommonMark contains this little sentence to work around its specified behavior, which is left untouched in the GFM spec:
> A renderer may also provide an option to render soft line breaks as hard line breaks.
I'd say whether or not it does this is a rather important thing to mention. When I write Markdown documents for GitHub I have to change my editor settings, only because of this.
[1]: https://guides.github.com/features/mastering-markdown/
[2]: https://help.github.com/articles/basic-writing-and-formattin...
> --hardbreaks Treat newlines as hard line breaks
We turn this option on when rendering issues, issue comments and so on, but leave it off when rendering blobs (such as README.md). Both are GFM, one just uses this option to make it more conducive to communication.
Do you mind to make sure this is reflected in docs?
> There is a fundamental difference between these two kinds of content: the user comments are stored in our databases, which means their Markdown syntax can be normalized (e.g. by adding or removing whitespace, fixing the indentation, or inserting missing Markdown specifiers until they render properly). The Markdown documents stored in Git repositories, however, cannot be touched at all, as their contents are hashed as part of Git’s storage model.
Well, actually it does say that "Hard line breaks are for separating inline content within a block."
https://github.github.com/gfm/#hard-line-break
So two spaces at the end of the line for a <br>, and an empty line for <p>.