markdown with mistune
This commit is contained in:
parent
80d26aa934
commit
abc2bb243c
2 changed files with 4 additions and 4 deletions
|
@ -39,7 +39,7 @@ from pathlib import Path
|
|||
import unicodedata
|
||||
import locale
|
||||
import requests
|
||||
import commonmark
|
||||
import mistune
|
||||
|
||||
# set user locale
|
||||
locale.setlocale(locale.LC_ALL, "")
|
||||
|
@ -123,7 +123,7 @@ def read_content(filename):
|
|||
|
||||
# Convert Markdown content to HTML.
|
||||
if filename.endswith((".md", ".mkd", ".mkdn", ".mdown", ".markdown")):
|
||||
text = commonmark.commonmark(text)
|
||||
text = mistune.markdown(text)
|
||||
|
||||
# Update the dictionary with content and RFC 2822 date.
|
||||
content.update({"content": text, "rfc_2822_date": rfc_2822_format(content["date"])})
|
||||
|
@ -233,7 +233,7 @@ def make_posts(
|
|||
avatar=comment.get("avatar", ""),
|
||||
site=comment.get("site", ""),
|
||||
date=comment["date"],
|
||||
content=commonmark.commonmark(comment["content"]),
|
||||
content=mistune.markdown(comment["content"]),
|
||||
)
|
||||
out_comments.append(out_comment)
|
||||
page_params["comments"] = "".join(out_comments)
|
||||
|
|
|
@ -4,9 +4,9 @@ black==19.3b0
|
|||
certifi==2019.6.16
|
||||
chardet==3.0.4
|
||||
Click==7.0
|
||||
commonmark==0.9.0
|
||||
future==0.17.1
|
||||
idna==2.8
|
||||
mistune==0.8.4
|
||||
requests==2.22.0
|
||||
toml==0.10.0
|
||||
urllib3==1.25.3
|
||||
|
|
Loading…
Add table
Reference in a new issue