Render centered and caption inline instead of dropping them#51
Open
calsmith1-nokia wants to merge 1 commit into
Open
Render centered and caption inline instead of dropping them#51calsmith1-nokia wants to merge 1 commit into
calsmith1-nokia wants to merge 1 commit into
Conversation
calsmith1-nokia
commented
Apr 16, 2026
| .. figure:: /static/markdown.png | ||
| :alt: Captioned figure example. | ||
|
|
||
| Figure caption text. |
Author
There was a problem hiding this comment.
:caption: is invoked from here, not :alt:
The centered and caption docutils node types have no visit handler in the translator and currently fall through to unknown_visit and SkipNode. Their inner text is silently dropped: ".. centered::" lines vanish, and figure captions and code-block ":caption:" filenames are lost. Mark both as transparent wrappers in PREDEFINED_ELEMENTS so their inner text is emitted inline. The output is intentionally minimal (no bold, italic, or layout styling) -- the goal of this change is to end the silent data loss; richer rendering can come in a follow-up. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
calsmith1-nokia
force-pushed
the
transparent-centered-and-caption
branch
from
April 16, 2026 23:15
9b749b5 to
af0bc39
Compare
calsmith1-nokia
marked this pull request as ready for review
April 16, 2026 23:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See commit message for the rationale and approach.
Notes for reviewers
The current rendering is intentionally minimal — it just preserves the text. Caption text is concatenated to the image / appears as a paragraph above the code fence rather than being styled as a label. A future change could give
captiona richer handler (e.g., bold, italic, or a separator); this PR scopes itself to ending the silent data loss.Test plan
make lintclean (pylint 10.00/10).make test— pytest 13/13 passing, 98% coverage.make test-diff—ExampleRSTFile.mdandindex.mdclean. (Identical pre-existing intersphinx-network diffs on other files are present on stockmain.)