forked from CrossDark/CrossDown
1.9.6 修bug
This commit is contained in:
parent
280518f985
commit
d6107c6adf
@ -24,6 +24,7 @@ class HighlightHtmlFormatter(HtmlFormatter):
|
|||||||
"""
|
"""
|
||||||
用于给code highlight扩展添加语言类型
|
用于给code highlight扩展添加语言类型
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, lang_str='', **options):
|
def __init__(self, lang_str='', **options):
|
||||||
"""
|
"""
|
||||||
初始化
|
初始化
|
||||||
@ -209,6 +210,7 @@ class CodeLine(Treeprocessor):
|
|||||||
"""
|
"""
|
||||||
渲染单行代码
|
渲染单行代码
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, variable: Dict):
|
def __init__(self, variable: Dict):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.variable = variable
|
self.variable = variable
|
||||||
@ -334,6 +336,8 @@ class Code(Extension):
|
|||||||
# md.treeprocessors.register(CodeBlock(), 'code_block', 1) # 渲染多行代码块
|
# md.treeprocessors.register(CodeBlock(), 'code_block', 1) # 渲染多行代码块
|
||||||
|
|
||||||
|
|
||||||
def main(text: str, variable: Dict) -> Tuple[str, Dict[str, List[str]]]:
|
def main(text: str, variable: Union[Dict[str, str], None] = None) -> Tuple[str, Dict[str, List[str]]]:
|
||||||
|
if variable is None:
|
||||||
|
variable = {}
|
||||||
md = Markdown(extensions=[Basic(), Box(), Anchor()] + list(Extensions.values()) + [Code(variable=variable)])
|
md = Markdown(extensions=[Basic(), Box(), Anchor()] + list(Extensions.values()) + [Code(variable=variable)])
|
||||||
return md.convert(text), md.Meta
|
return md.convert(text), md.Meta
|
||||||
|
@ -73,3 +73,5 @@ span.linenos.special { color: #000000; background-color: #ffffc0; padding-left:
|
|||||||
.codehilite .vi { color: #19177C } /* Name.Variable.Instance */
|
.codehilite .vi { color: #19177C } /* Name.Variable.Instance */
|
||||||
.codehilite .vm { color: #19177C } /* Name.Variable.Magic */
|
.codehilite .vm { color: #19177C } /* Name.Variable.Magic */
|
||||||
.codehilite .il { color: #666666 } /* Literal.Number.Integer.Long */
|
.codehilite .il { color: #666666 } /* Literal.Number.Integer.Long */
|
||||||
|
|
||||||
|
.block {background-color: grey; color: white;} /* 灰色背景,白色文字 */
|
||||||
|
2
setup.py
2
setup.py
@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
|
|||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name="CrossDown",
|
name="CrossDown",
|
||||||
version="2.0.0",
|
version="2.0.1",
|
||||||
author="CrossDark",
|
author="CrossDark",
|
||||||
author_email="liuhanbo333@icloud.com",
|
author_email="liuhanbo333@icloud.com",
|
||||||
description="CrossDark's MarkDown",
|
description="CrossDark's MarkDown",
|
||||||
|
Loading…
Reference in New Issue
Block a user