работа с шаблонами
This commit is contained in:
@@ -7,11 +7,15 @@ def render_markdown_to_docx(doc, md_content: str, images_dir, style_reg: StyleRe
|
||||
ast = markdown(md_content)
|
||||
|
||||
def walk(node):
|
||||
handler = get_handler(node["type"])
|
||||
if handler:
|
||||
handler(node, doc, images_dir, style_reg)
|
||||
elif node.get("children"):
|
||||
for child in node["children"]:
|
||||
walk(child)
|
||||
if isinstance(node, list):
|
||||
for item in node:
|
||||
walk(item)
|
||||
elif isinstance(node, dict):
|
||||
handler = get_handler(node["type"])
|
||||
if handler:
|
||||
handler(node, doc, images_dir, style_reg)
|
||||
elif node.get("children"):
|
||||
for child in node["children"]:
|
||||
walk(child)
|
||||
|
||||
walk(ast)
|
||||
Reference in New Issue
Block a user