问题
Writing a readme in github I run into the problem that if I want a paragraph of text after a list it interprets it as just more of the list:
* List item
More text
Shows up as:
List item
More text
I tried looking at a few other github repos but I can't tell why theirs are working and mine isn't.
example
回答1:
In stack exchange posts and GitHub markdown you can use an HTML tag to force the end of a list:
- one
- two
- three
<a/>
not a list item
produces:
- one
- two
- three
not a list item
Or on GitHub you can use a markdown comment:
- one
- two
- three
[//]: # (Hello)
not a list item
A gist showing GitHub markdown: https://gist.github.com/schlueter/ee90c7097f633ac90d3a9da56e6a69e1
回答2:
You may add a new line after your list heading, and tab your list content. In this way when a new list is started it will be separate from previous list.
回答3:
you can do that by writing two skipping line like this
\n\n
for example
1. this is a List Item 1
2. this is a List Item 2\n\n
Here I'm leaving the List.
which will output the following:
this is a List Item 1
this is a List Item 2\n\n
Here I'm leaving the List.
回答4:
You can also end the Markdown list using an HTML comment <!-- --> which won't be visible in the rendered output and it works also on Stack Exchange sites.
Just put that comment on a separate line after a list with an empty line both before and after it. The comment doesn't have to have any content:
- List item 1
- List item 2
<!-- end of the list -->
code_block() {
...
来源:https://stackoverflow.com/questions/18313462/github-markdown-wont-end-a-list