首页 文章

为什么表不能在Python-markdown中工作?

提问于
浏览
1

我试图在Python-markdown的帮助下使用Markdown语法将表格呈现为HTML:https://python-markdown.github.io/

我试过这里提供的例子:https://python-markdown.github.io/extensions/tables/

from markdown import markdown

s = """
First Header  | Second Header
------------- | -------------
Content Cell  | Content Cell
Content Cell  | Content Cell
"""

html = markdown(s)
print(html)

但我得到的结果是:

<p>First Header  | Second Header
------------- | -------------
Content Cell  | Content Cell
Content Cell  | Content Cell</p>

怎么了?

1 回答

相关问题