Markdown 列表在彼此之下
* foo
* bar
生产
<ul>
<li>foo</li>
<li>bar</li>
</ul>
和
* foo
* bar
生产
<ul>
<li><p>foo</p></li>
<li><p>bar</p></li>
</ul>
在我想要的时候
<ul>
<li><p>foo</p></li>
</ul>
<ul>
<li><p>bar</p></li>
</ul>
解决方案是什么?
* foo
* bar
produces
<ul>
<li>foo</li>
<li>bar</li>
</ul>
and
* foo
* bar
produces
<ul>
<li><p>foo</p></li>
<li><p>bar</p></li>
</ul>
while I want
<ul>
<li><p>foo</p></li>
</ul>
<ul>
<li><p>bar</p></li>
</ul>
What's the solution?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于大多数 Markdown 实现都支持 HTML,因此您可以只使用两个列表之间的注释,因此这将是解决此问题的最安全、最干净的解决方案。
像这样:
但是,这不会为您提供
,因此如果您确实需要它们,则需要在此处使用内联 HTML。
(在大多数实现中,您不需要在 markdown 中关闭
— 它们会被 markdown 自动关闭)
这是使用 stackoverflow 的 markdown 的第二个实时示例:
a< /p>
b
Since the majority of markdown implementations support the HTML, you can just use the comment between two lists, so it would be the safest and cleanest possible solution for this issue.
Like this:
However, that won't give you the
<p>
, so if you'd really need them, you'd need to use the inline HTML here.(in most implementations you won't need to close the
<p>
in markdown — they would be closed automatically by markdown)Here is a live second example using the stackoverflow's markdown:
a
b