New lines inside paragraph in README.md

GithubMarkdownGithub Flavored-MarkdownReadme

Github Problem Overview


When editing an issue and clicking Preview the following markdown source:

a
b
c

shows every letter on a new line.

However, it seems to me that pushing similar markdown source structure in README.md joins all the letters on one line.

I'd like the new lines preserved in the README.md in this project: https://github.com/zoran119/simple-read-only-test

Any idea how?

Github Solutions


Solution 1 - Github

Interpreting newlines as <br /> used to be a feature of Github-flavored markdown, but the most recent help document no longer lists this feature.

Fortunately, you can do it manually. The easiest way is to ensure that each line ends with two spaces. So, change

a
b
c

into

a__
b__
c

(where _ is a blank space).

Or, you can add explicit <br /> tags.

a <br />
b <br />
c

Solution 2 - Github

You can use a backslash at the end of a line.
So this:

a\
b\
c

will then look like:

a
b
c

Notice that there is no backslash at the end of the last line (after the 'c' character).

Solution 3 - Github

If you want to be a little bit fancier you can also create it as an html list to create something like bullets or numbers using ul or ol.

<ul>
<li>Line 1</li>
<li>Line 2</li>
</ul>

Solution 4 - Github

You should use html break <br/> tag

a <br/>
b <br/>
c

Solution 5 - Github

According to Github API two empty lines are a new paragraph (same as here in stackoverflow)

You can test it with http://prose.io

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionzoran119View Question on Stackoverflow
Solution 1 - GithubtbekolayView Answer on Stackoverflow
Solution 2 - GithubWaldmannView Answer on Stackoverflow
Solution 3 - GithubSwitch900View Answer on Stackoverflow
Solution 4 - GithubRaj KView Answer on Stackoverflow
Solution 5 - GithubbgauryyView Answer on Stackoverflow