Skip to content

Fix verbatim padding at either backtick boundary - #325

Merged
dereuromark merged 1 commit into
masterfrom
fix/verbatim-boundary-spaces
Oct 21, 2026
Merged

dereuromark merged 1 commit into
masterfrom
fix/verbatim-boundary-spaces

Conversation

@dereuromark

Copy link
Copy Markdown
Contributor

Change

Djot removes one padding space independently at either end of verbatim text when the content touches a backtick. The PHP parser required spaces at both ends, which added spaces to six code spans in the authored-document benchmark. This change follows the Djot rule and matches djot.js on all three documents.

The HTML-to-Djot converter now pads only the needed end. A code value with a significant space next to a boundary backtick cannot be written as one Djot verbatim span, so that rare case uses an escaped <code> raw-inline form. It retains id, class, and title and drops event attributes.

Checks

  • PHPUnit: 4,627 tests, 31,217 assertions.
  • PHPStan and PHPCS: passed.
  • The three benchmark Djot fixtures have the same projected HTML in djot-php and djot.js.

@dereuromark dereuromark added bug Something isn't working skip-changelog labels Oct 21, 2026
@codecov

codecov Bot commented Oct 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.21%. Comparing base (14afedd) to head (0498f20).

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #325   +/-   ##
=========================================
  Coverage     93.20%   93.21%           
  Complexity     4815     4815           
=========================================
  Files           118      118           
  Lines         12812    12821    +9     
=========================================
+ Hits          11942    11951    +9     
  Misses          870      870           

☔ 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 4ccf5cc into master Oct 21, 2026
6 checks passed
@dereuromark
dereuromark deleted the fix/verbatim-boundary-spaces branch October 21, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working skip-changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant