New lines inside paragraph in README.md

試著忘記壹切 提交于 2019-12-18 09:57:09

问题


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?


回答1:


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



回答2:


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>



回答3:


Just use back slash in the end of the line.
So this:
a\
b\
c
will then look like:

a
b
c

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




回答4:


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

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



来源:https://stackoverflow.com/questions/24575680/new-lines-inside-paragraph-in-readme-md

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!