forked from CrossDark/CrossDown
V0.1.1修正
This commit is contained in:
parent
fd82afdaa4
commit
8c713d206d
15
CrossDown.py
15
CrossDown.py
@ -136,6 +136,9 @@ class CodeBlock:
|
|||||||
def __call__(self, *args, **kwargs):
|
def __call__(self, *args, **kwargs):
|
||||||
return re.sub(r'`[^`]*`', '', self.text)
|
return re.sub(r'`[^`]*`', '', self.text)
|
||||||
|
|
||||||
|
def restore(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class Basic:
|
class Basic:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -184,15 +187,7 @@ def main(origen: str):
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
with open('test.md', encoding='utf-8') as test:
|
with open('test.md', encoding='utf-8') as test:
|
||||||
cd = f"""<!DOCTYPE html>
|
cd = main(test.read())
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>页面标题</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
{main(test.read())}
|
|
||||||
</body>
|
|
||||||
</html>"""
|
|
||||||
with open('test.html', 'w', encoding='utf-8') as html:
|
with open('test.html', 'w', encoding='utf-8') as html:
|
||||||
html.write(f"""<!DOCTYPE html>
|
html.write(f"""<!DOCTYPE html>
|
||||||
<html lang="zh-CN">
|
<html lang="zh-CN">
|
||||||
@ -206,4 +201,4 @@ if __name__ == '__main__':
|
|||||||
{add_indent_to_string(cd, 4)}
|
{add_indent_to_string(cd, 4)}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
""")
|
""")
|
||||||
|
Loading…
Reference in New Issue
Block a user