diff --git a/src/handlers/builtin.py b/src/handlers/builtin.py index 5952d93..8717897 100644 --- a/src/handlers/builtin.py +++ b/src/handlers/builtin.py @@ -23,17 +23,26 @@ def _render_inline_tokens(p, tokens, doc, images_dir, style_reg): elif token["type"] == "strong": run = p.add_run() run.bold = True - run.text = token["children"][0]["raw"] if token["children"] else "" + # Обрабатываем children внутри этого же run + for child in token["children"]: + if child["type"] == "text": + run.text += child["raw"] elif token["type"] == "emphasis": run = p.add_run() run.italic = True - run.text = token["children"][0]["raw"] if token["children"] else "" + for child in token["children"]: + if child["type"] == "text": + run.text += child["raw"] elif token["type"] == "link": run = p.add_run() run.text = token["children"][0]["raw"] if token["children"] else "" run.font.color.rgb = style_reg.get_color("LinkColor") + elif token["type"] == "softbreak" or token["type"] == "linebreak": + p.add_run().add_break() + elif token["type"] == "html": + if "