Repository navigation
Conversation
After a block title such as `.Procedure`, every following non-empty line was collected into the caption buffer, which is only emitted when a table, picture, list or literal block comes next. A titled paragraph and all text after it up to such a block was dropped, and a block title at the end of the document was lost too. A block title is a single line, so emit it as the bold paragraph the parser already uses for a target without a caption slot, and keep the paragraph as a paragraph. Signed-off-by: Rohit Behera <126186063+r0h1tb@users.noreply.github.com>
Contributor
|
✅ DCO Check Passed Thanks @r0h1tb, all your commits are properly signed off. 🎉 |
Contributor
Merge Protections🟢 Merge protection satisfied — ready to merge. Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This branch has not been deployed
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.
Problem
A block title in front of a paragraph drops the paragraph and all the text after it:
After
.Block title, the "allow multiline captions" branch appends every following non-empty line tocaption_data. That buffer is only emitted when a table, picture, list or literal block comes next, so everything up to that point, or to the end of the document, is lost without an error. A block title with nothing after it is lost the same way.Fix
A block title is a single line, so the line after it starts the paragraph it titles. The block title is now emitted as a bold paragraph just before it, which is what
_parse's docstring already describes for targets without a caption slot, and what the list branch does. The pending title is also flushed at the end of the document. The list branch now uses the same helper; its behaviour is unchanged.Tests
Two new tests in
tests/test_backend_asciidoc.py: a titled paragraph followed by more text (exact labels, texts and order, bold title), and a block title at the end of the document. Both fail on main. The asciidoc module goes from 17 passed to 19, with the example groundtruth unchanged. ruff is clean and ty reports no new diagnostics beyond the file's existing_backend.convert()warnings.Checklist: