Apply adjacent-inline separator on all inline buffers in HtmlToDjot#206
Merged
Merged
Conversation
The same-delimiter separator added in #205 only ran through processChildren(), so it covered paragraphs but not the two other places that buffer inline output by hand: processBlock() (bare top-level inline) and processList() (list-item content). There `<em>a</em><em>b</em>` still serialized to `_a__b_` and round-tripped to `<em>a_</em>b_`. Extract the join into a shared appendInline() helper and use it on all three concatenation paths, so adjacency is handled the same everywhere. Extend the property test with bare and list contexts across em, strong, sub, sup and code.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #206 +/- ##
============================================
+ Coverage 91.79% 91.82% +0.03%
- Complexity 3457 3458 +1
============================================
Files 104 104
Lines 9798 9799 +1
============================================
+ Hits 8994 8998 +4
+ Misses 804 801 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Follow-up to #205, which fixed adjacent same-delimiter inline runs but only on the
processChildren()path.Problem
The separator in #205 covered paragraphs, but two other code paths buffer inline output by hand and so still produced the malformed token:
(Paragraph-wrapped input was already correct after #205.)
Fix
Extract the inline join into a shared
appendInline()helper that inserts the{}separator when two pieces would merge a same-delimiter run, and use it on all three concatenation paths:processChildren(), theprocessBlock()inline buffer, and theprocessList()list-item buffer. Table cells already delegate to those, so they are covered too.The property test gains bare-top-level and list-item adjacency cases across
em,strong,sub,supandcode, asserting (whitespace-normalized) that the two runs stay separate regardless of the surrounding block.