Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

New lines inside paragraph in README.md

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?

like image 294
zoran119 Avatar asked Jul 04 '14 13:07

zoran119


People also ask

How do you insert a line break in markdown?

To create a line break or new line ( <br> ), end a line with two or more spaces, and then type return. This is the first line.

How do I create a new line in readme github?

If you want a blank line, you insert one blank line — or more, if you want bigger blank space — in between two lines of text. ###### This is as small as it gets before regular text.

How do you start a new paragraph in markdown?

A paragraph is consecutive lines of text with one or more blank lines between them. For a line break, add either a backslash \ or two blank spaces at the end of the line. paragraph.


3 Answers

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
like image 170
tbekolay Avatar answered Nov 08 '22 08:11

tbekolay


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).

like image 42
Waldmann Avatar answered Nov 08 '22 08:11

Waldmann


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>
like image 30
Switch900 Avatar answered Nov 08 '22 08:11

Switch900