From 1dbd05e57e4371b36cec6192d93cd1bd88e247a1 Mon Sep 17 00:00:00 2001 From: Mikan <72257910+Mikan-DS@users.noreply.github.com> Date: Mon, 8 Dec 2025 17:09:16 +0300 Subject: [PATCH] table + list --- src/handlers/builtin.py | 56 +++++++++++++++----- tests/test_handlers.py | 111 +++++++++++++++++++++++++++++++--------- 2 files changed, 129 insertions(+), 38 deletions(-) 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 "