Skip to content

Keep tight list items unwrapped when source lines are enabled - #265

Merged
dereuromark merged 1 commit into
masterfrom
fix/source-lines-tight-structure
Jul 18, 2026
Merged

Keep tight list items unwrapped when source lines are enabled#265
dereuromark merged 1 commit into
masterfrom
fix/source-lines-tight-structure

Conversation

@dereuromark

Copy link
Copy Markdown
Contributor

Enabling sourceLines grew <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.

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.
@dereuromark dereuromark added the bug Something isn't working label Jul 18, 2026
@codecov

codecov Bot commented Jul 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.39%. Comparing base (3ac5a79) to head (9267c3b).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dereuromark
dereuromark merged commit 5c29c6e into master Jul 18, 2026
6 checks passed
@dereuromark
dereuromark deleted the fix/source-lines-tight-structure branch July 18, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant