Skip to content

docs build does not catch nested inline RST markup (renders as literal backticks, sphinx exits 0) #30

Closed

Description

@settylab-dotto-bot

Summary

Nested inline markup is invalid reStructuredText, renders as literal
backticks in the built HTML, and nothing in the docs build catches it.
sphinx-build exits 0 with no warning, so the only thing standing between this
class and a published page is whoever happens to look at the rendered output.

It occurred three times in a single session while writing #29, each time in
prose that read perfectly in the source:

**Supplying ``sample_col`` multiplies the cost by the gene count.**
**The ``dask`` path wins on every instrument**
**The ``dask``-less path is a different bargain ...**

All three render with the backticks visible:

<p><strong>The ``dask`` path wins on every instrument</strong>, and that is ...

Three instances of one shape is a missing check rather than three mistakes.

Why it is easy to write and hard to see

The rule — inline markup cannot nest — is not one most people hold while
writing, and the source reads exactly as intended. A literal inside a bold span
is the natural way to write "the dask path wins" when the emphasis
belongs to the whole clause. Docutils does not warn: it simply stops treating
the inner markers as markup.

It is also invisible to every check we already run. sphinx-build -b html is
clean, the page builds, links resolve, and the only symptom is two stray
backticks in a paragraph nobody re-reads after the first review.

How it was caught, and the suggestion

By scanning the built HTML for markup that should never survive rendering —
unrendered literals, directive lines, unresolved roles:

for page in glob.glob(f"{build}/*.html"):
    h = open(page, encoding="utf-8").read()
    leaks = (h.count("``") + h.count(".. warning::") + h.count(".. note::")
             + h.count(":doc:`") + h.count(":ref:`"))

Zero is the only acceptable count, and it found all three instances plus a
:ref: accidentally written inside a code-block comment, where roles are not
interpreted.

Worth making a docs-build check rather than an agent's habit — a few lines in
docs/ run after sphinx-build, failing on a non-zero count. It needs no
knowledge of the RST rules; it just asserts that nothing that is supposed to be
markup survived as text.

A source-side linter (doc8, rstcheck) is the other option, but the HTML scan
is strictly better here: it catches the code-block-comment case and anything
else that fails to render, without needing a rule per construct.

Scope

Documentation infrastructure only; no runtime effect. Filed separately from #29
rather than folded into it, since it is about the build rather than about that
change.

Activity

  1. added a commit that references this issue on Sep 15, 2026
  2. added 5 commits that reference this issue on Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions