Skip to content

Latest commit

 

History

History
22 lines (13 loc) · 1.1 KB

File metadata and controls

22 lines (13 loc) · 1.1 KB

mistune: Preserving RST List Item State

Upstream PR: lepture/mistune#456

Bug

Rendering an RST list item containing text and blockquotes could lose the previous-token state used by the renderer. That made separators inconsistent and exposed a prev lookup failure in the list item path.

Contract

RST list item rendering should behave like top-level RST rendering: non-blank child tokens need a stable prev relationship, and separate blockquotes should still be separated correctly.

Fix

render_list_item() now tracks prev between non-blank child tokens. RSTRenderer.block_quote() also treats block_text like paragraph for separator suppression, avoiding a spurious .. before the first quote inside a list item.

Verification

  • uv run --group dev python -m pytest tests/test_renderers.py -q -> 55 passed
  • uv run --group dev python -m pytest -q -> 1112 passed, 3 subtests passed
  • uv run --group dev ruff check src/mistune/renderers/_list.py src/mistune/renderers/rst.py tests/test_renderers.py -> passed
  • git diff --check -> passed