Skip to content

Retire the post-render doctest fixes - #320

Merged
rich-iannone merged 2 commits into
posit-dev:mainfrom
has2k1:no-post-render-doctest
Aug 18, 2026
Merged

Retire the post-render doctest fixes#320
rich-iannone merged 2 commits into
posit-dev:mainfrom
has2k1:no-post-render-doctest

Conversation

@has2k1

@has2k1 has2k1 commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

This PR removes the two HTML passes that repaired doctest blocks after Quarto rendered them.
Ref: PR #284

has2k1 added 2 commits August 17, 2026 15:42
Doctest prompts are now fenced as Python before the docstring is parsed,
so Pandoc never reads a leading `>` as a blockquote marker. The HTML pass
that rebuilt those blockquotes into a code block had nothing left to
repair; removing it leaves the rendered reference pages byte-identical.

Add a render-level test that no doctest prompt reaches the qmd outside a
code fence, covering prompts inside an Examples section and loose in the
subject, consecutive prompt groups, a Google-style header under the numpy
parser, and a class with its members.
Doctest prompts are fenced as Python before the docstring is parsed, so
Quarto highlights every doctest block itself and never leaves one as an
unhighlighted code block. The HTML pass that re-highlighted those blocks
had no matching input; removing it leaves the rendered reference pages
byte-identical under the numpy, google and sphinx parsers.

Drop its tests, along with the Pygments namespace scaffolding that only
those tests needed. Widen the fence test to the shapes that motivated the
pass: a literal block, an indented group pair, a list item, and docstrings
written in Google and Sphinx style under their own parsers.

@rich-iannone rich-iannone left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@rich-iannone
rich-iannone merged commit b898ddd into posit-dev:main Aug 18, 2026
8 checks passed
@has2k1
has2k1 deleted the no-post-render-doctest branch August 19, 2026 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants