我试图创建降价名单。正如我读过一些文档中,如果我写这个降价的代码:
My list
* first item
* second item
* third item
Not in the list
我会得到的结果一样,如果我写这篇文章的HTML:
<p>My list</p>
<li>
<ul>first item</ul>
<ul>second item</ul>
<ul>third item</ul>
</li>
<p>Not in the list</p>
我用原子作为编辑和预览降价,一切正常,但是当我使用pandoc
转换我的降价文件,如下所示:
pandoc test.md -o test.odt
我所得到的是这样的:
My list * first item * second item * third item
Not in the list
我在哪里做错了吗?
有你的问题,有两种可能的解决方案:
My list
* first item
* second item
* third item
Not in the list
commonmark
作为input format而不是默认的,markdown
。
pandoc -f commonmark -o test.odt test.md
“问题”是,凌动编辑器使用CommonMark解析器,默认情况下,Pandoc使用这主要是如下these rules和参考实现(markdown.pl
)一个老派的降价解析器。事实上,Commonmark spec明确承认这种差异:
在CommonMark,列表可以中断一个段落。也就是说,没有空行是需要分开从以下列表中的一段话:
Foo - bar - baz <p>Foo</p> <ul> <li>bar</li> <li>baz</li> </ul>
Markdown.pl
不允许这样,通过经由恐惧在硬包装线的数字触发列表:The number of windows in my house is 14. The number of doors is 6.
如果你希望你的工具之间的共同行为,那么你只需要使用它遵循同样的行为的工具。