Keep tight list items unwrapped when source lines are enabled - #265
Merged
Conversation
The tight-list renderer strips a plain paragraph wrapper from item content, but a paragraph stamped with data-source-line no longer matched the pattern, so enabling sourceLines grew <p> wrappers inside tight items - a structure change the opt-in attribute-only option must never cause. Strip anchor-only wrappers the same way (the li keeps its own anchor, matching carve-js and carve-rs) and lock the contract with a byte-identity regression test.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #265 +/- ##
=========================================
Coverage 92.39% 92.39%
Complexity 3668 3668
=========================================
Files 109 109
Lines 10407 10407
=========================================
Hits 9616 9616
Misses 791 791 ☔ View full report in Codecov by Harness. 🚀 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.
Enabling
sourceLinesgrew<p>wrappers inside tight list items: the tight-strip pattern in the renderer only matched a bare<p>, and stamped paragraphs no longer matched. The option is documented as attribute-only, so output structure must be byte-identical modulo the stamped attributes.The tight-strip now also strips a
data-source-line-only wrapper (the<li>keeps its anchor - same shape carve-js and carve-rs emit), and a regression test asserts on-output equals off-output after removing the attributes.Found via a three-implementation cross-check harness (php/js/rs) on nested-list documents.