diff --git a/CrossDown/Core.py b/CrossDown/Core.py index d315974..6de1080 100644 --- a/CrossDown/Core.py +++ b/CrossDown/Core.py @@ -36,7 +36,7 @@ class HighlightHtmlFormatter(HtmlFormatter): super().__init__(**options) self.lang_str = lang_str.split('-')[-1] - def _wrap_code(self, source): + def _wrap_code(self, source: str): yield 0, f'' yield from source yield 0, '' @@ -329,7 +329,13 @@ class Code(Extension): md.treeprocessors.register(CodeLine(variable=self.variable), 'code_line', 0) # 渲染单行代码块 -def main(text: str, variable: Variable = None) -> Tuple[str, Dict[str, List[str]]]: +def main(text: str, variable: Variable = None) -> Tuple[str, Dict[str, Variable]]: + """ + 主函数 + :param text: 输入文本 + :param variable: 变量字典 + :return: 返回html与元数据字典 + """ if variable is None: variable = {} md = Markdown(extensions=[Basic(), Box(), Anchor()] + list(Extensions.values()) + [Code(variable=variable)]) diff --git a/setup.py b/setup.py index a0a134c..67f8c18 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ with open("README.md", "r") as fh: setuptools.setup( name="CrossDown", - version="2.0.1", + version="2.0.2", author="CrossDark", author_email="liuhanbo333@icloud.com", description="CrossDark's MarkDown",