Repository navigation
fix(asciidoc): flush pending text at section headers - #4428
Merged
PeterStaar-IBM merged 1 commit intoSep 28, 2026
Merged
Conversation
A heading ended the paragraph being accumulated only implicitly: the text before the heading stayed in text_data, was joined with the text after the heading, and was attributed to the latter's section. 'body' under === S1.1 followed by == S2 and 'body2' came out as one paragraph 'body body2' parented under S2. Flush the pending text (into the section it was written under) before adding the heading. Red/green verified: the new test fails against the old implementation (one merged paragraph under S2) and passes with the fix. Signed-off-by: simpleqt <[email protected]>
Contributor
|
✅ DCO Check Passed Thanks @simpleqt, 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! |
1 of 3 tasks
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.
Summary
When a section header immediately follows body text (no blank line), the heading does not end the accumulated paragraph:
→ a single paragraph
body body2, parented under S2 — so "body" is attributed to the wrong section in the document tree.Fix
The section-header branch now flushes
text_data(via the existing_flush_text_data) into the current parent — the section the text was actually written under — before adding the heading. Blank-line-separated text was already flushed by the blank-line branch; this closes the no-blank-line case.Regression test
Added
test_heading_flushes_pending_paragraphintests/test_backend_asciidoc.py:S2) and passes with the fixbody→S1.1,body2→S2tests/test_backend_asciidoc.pysuite passes: 19 passedruff checkandruff formatpass on both touched files.