测试md文本
python
md_text = """
# title
## subtitle
\```python
print("Hello, World!")
\```
- item 1
| Header 1 | Header 2 |
|----------|----------|
| Row 1 Col 1 | Row 1 Col 2 |
- item 2
> This is a blockquote.
### Subsubtitle
This is a paragraph with **bold text** and *italic text*.
欢迎使用 Markdown 语法来编写文档。以下是一些常见的 [Markdown](https://test.html) 特性:
""".strip()
基于markdown
python
# pip install markdown -U
import markdown
from IPython.display import display, HTML
converted = markdown.markdown(md_text, extensions=["tables", "fenced_code"], output_format="html")
html_text = f"""<!DOCTYPE html>
<html>
<head><meta charset="UTF-8"></head>
<body>
{converted}
</body>
</html>"""
display(HTML(html_text))

基于md2html-phuker
python
# pip install -U md2html-phuker
from md2html import md2html
html_text = md2html.convert(md_text)
display(HTML(html_text))
