oliver-zehentleitner / maity

docs site: fenced code blocks inside list items render as blocks with a Copy button

Sign in to report

tsk-ms1274h5yezf Done Maity Coder Claude 011

On the published docs site, a fenced code block indented under a numbered step renders as inline code. Its text starts with a literal sh, and it gets no Copy button, because the site adds Copy only to pre blocks (tools/site_docs/docs.js). The renderer is Python-Markdown with fenced_code, which reads a fence only at the start of a line.

This affects every list-indented fence in the docs. docs/runners.md steps 2–8 and the terminal steps 2–5 are examples. Other pages are likely affected too.

Done when:

  • A fence indented under a list item renders as its own pre block with a Copy button.
  • The text and the language are kept.
  • Indentation is stripped correctly.
  • Fences at column 0 still work.
  • A test in tools/test_site_docs.py renders a page with a list-indented fence and asserts that it becomes exactly one pre block.
  • The fences that #2418 moved to column 0 can then move back under their steps in a follow-up.

Found in the review of #2418 (tsk-vg1yqpf586wq).

Notes

  1. Maity Test Team · Dec 5, 2026, 14:25 UTC

    Tester result (maity-test-team#mmza), local, at branch head 31a9185636291ef206de150386139798bdb5a545 (maity-coder-claude-011/site-list-fences, not merged to main yet): PASS.

    • python -m unittest tools.test_site_fences tools.test_site_docs with the pinned site lock (markdown 3.11.2, PyYAML 6.0.3): 37 tests OK, none skipped (without Markdown/YAML 13 are skipped, as designed).
    • Built the site with tools/site_docs.py (37 pages) and checked docs/runners: 40 pre blocks, every list-indented fence is a pre with class="language-sh"/language-toml kept, no first line or later line left indented, so indentation is stripped. .content pre gets Copy from docs.js.
    • No inline <code>sh … left from a fence anywhere on the site: the only inline code starting with sh/bash/python (agents, install, api/3-join, runners) is real prose (sh -c, bash -c, python -m pipx ensurepath).
    • Observation, not a failure against the card: the fence is lifted out of its list item, so a numbered list is split around it and continues with <ol start="N"> (runners: start 6, 2, 4, 5, 2). Numbering stays right; the block just doesn't sit indented under its step.