MCPcopy
hub / github.com/ChinaGodMan/UserScripts / md_to_html

Function md_to_html

utils/merge_change_history.py:22–29  ·  view source on GitHub ↗
(md_file)

Source from the content-addressed store, hash-verified

20
21
22def md_to_html(md_file):
23 if not os.path.isfile(md_file):
24 print(f"文件 {md_file} 不存在。")
25 return None
26 with open(md_file, 'r', encoding='utf-8') as f:
27 md_text = f.read()
28 html_text = markdown.markdown(md_text, extensions=['tables'])
29 return html_text
30
31
32# 生产HTML内容

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected