Markdown:包含代码元素的编号列表段落的问题 [英] Markdown: Problems with numbered list paragraphs containing code element

查看:483
本文介绍了Markdown:包含代码元素的编号列表段落的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在GitHub上创建了一个 README.md 文件,并且存在一些减价问题找不到解决方案。



当我输入时(点代表空格符号):

说明:..
.... 1。第一句话..

.... 2。第二句话。


........这是一些代码。



... 0.3。第三句..

.... 4。第四句

呈现为:

说明:

1.第一句

2.第二句


 这是一些代码。 

3.第三句话
4.第四句话

我可以将代码块从编号列表中分离吗?



我还想知道如何告诉Markdown忽略Markdown语法,因此我不必使用点作为空间标志的代表。

解决方案

这个如何?

 说明:

1.第一句
2.第二句

`这是一些代码.`

3.第三句
4.第四句

它不会缩进每个点,但是你的例子并没有做到这一点。
如果指令:之间的间隔和其余部分不是您想要的,您可以在它后面和后面两行使用双倍空间。



UPDATE:
如果您想保留列表的编号并将相对于列表中单个项目的代码放在列表中,您应该缩进代码块。
另外,在列表的第一个元素似乎有帮助之前有一个新行。


I created a README.md file on GitHub and there are some markdown problems I can't find a solution to.

When I enter this (The dots represent space signs):

Instructions:..
....1. First sentence..
....2. Second sentence..

........This is some code.

....3. Third sentence..
....4. Fourth sentence

It renders to this:

Instructions:
1. First sentence
2. Second sentence

    This is some code.

3. Third sentence
4. Fourth sentence

How can I separate the code block from the numbered list?

I would also like to know how I can tell Markdown to ignore Markdown syntax so I don't have to use dots as a representation of space signs.

解决方案

How about this?

Instructions:

1. First sentence
2. Second sentence

    `This is some code.`

3. Third sentence
4. Fourth sentence

It wouldn't indent each point, however your example with the dots doesn't do it either. If the spacing between Instructions: and the rest is not what you want, you can use the double space after it and on the two following lines.

UPDATE: After a little fiddling, if you want to keep the numbering of the list and put some code that's relative to a single item on the list you should indent the code block. Also, have a new line before the first element of the list seems to help.

这篇关于Markdown:包含代码元素的编号列表段落的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆