diff --git a/CrossDown/Core.py b/CrossDown/Core.py index 2d9dc3e..890ab99 100644 --- a/CrossDown/Core.py +++ b/CrossDown/Core.py @@ -310,6 +310,6 @@ class Code(Extension): # md.treeprocessors.register(CodeBlock(), 'code_block', 1) # 渲染多行代码块 -def main(text: str) -> Tuple[str, Dict[str, List[str]]]: - md = Markdown(extensions=[Basic(), Box(), Anchor()] + list(Extensions.values()) + [Code({'a': 'b', '强调变量': '强调值'})]) +def main(text: str, variable: Dict) -> Tuple[str, Dict[str, List[str]]]: + md = Markdown(extensions=[Basic(), Box(), Anchor()] + list(Extensions.values()) + [Code(variable=variable)]) return md.convert(text), md.Meta diff --git a/README.html b/README.html index 14f7405..badbaf3 100644 --- a/README.html +++ b/README.html @@ -184,7 +184,7 @@
// 定义了y范围
强调文本
-强调值
+变量值
A:
diff --git a/run.py b/run.py
index 51d28cb..e584580 100644
--- a/run.py
+++ b/run.py
@@ -8,7 +8,10 @@ if __name__ == '__main__':
start_time = time.perf_counter_ns()
# 主程序
with open('README.md', encoding='utf-8') as test:
- cd, meta = main(test.read())
+ cd, meta = main(test.read(), variable={
+ 'a': 'b',
+ '强调变量': '强调值'
+ })
print(meta)
with open('README.html', 'w', encoding='utf-8') as html:
html.write(f"""