提交 437e5edf 编写于 作者: M Mars Liu

support markdown code

上级 a07645f6
......@@ -192,9 +192,13 @@ def paragraph(state):
@Parsec
def code(state):
left = attempt(string("```")).then(many(attempt(inline))).over(string("\n"))
side = choice(attempt(string("````")), string("```"))
left = many(attempt(inline)).over(string("\n"))
side_token = side(state)
language = ''.join(left(state))
right = attempt(string("\n```").over(choice(attempt(string("\n")), eof)))
right = attempt(string("\n"+side_token).over(choice(attempt(string("\n")), eof)))
buffer = ""
while True:
try:
......
......@@ -367,7 +367,7 @@ class TreeWalker:
export.append(mfile)
flag = True
config["export"] = export
with open(md_file, encoding="utf-8") as efile:
with open(md_file, "r", encoding="utf-8") as efile:
data = efile.read()
state = BasicState(data)
try:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册