v0.5.4
Example document / build (push) Has been cancelled
Python application / build (push) Has been cancelled

NewPromt
- small fix
This commit is contained in:
Igor20264
2026-09-19 10:53:19 +03:00
parent f7136bd8bd
commit 5fb5010571
24 changed files with 4336 additions and 22 deletions
+11 -3
View File
@@ -216,12 +216,20 @@ def emit_markdown(blocks: list[Block], *, emit_page_breaks: bool = False) -> str
continue
if isinstance(b, ListBlock):
for idx, item in enumerate(b.items, start=1):
levels = b.item_levels or []
counters = [0] * 10
for idx, item in enumerate(b.items):
level = levels[idx] if idx < len(levels) else 1
level = max(1, min(level, 9))
body = escape_md_inline(item)
indent = " " * (level - 1)
if b.ordered:
chunks.append(f"{idx}. {body}")
counters[level - 1] += 1
for deeper in range(level, 10):
counters[deeper] = 0
chunks.append(f"{indent}{counters[level - 1]}. {body}")
else:
chunks.append(f"- {body}")
chunks.append(f"{indent}- {body}")
chunks.append("")
i += 1
continue