Skip to content

Fix HtmlToDjot remaining serialization edge cases#174

Merged
dereuromark merged 1 commit intomasterfrom
feature/fix-html-to-djot-remaining-serialization
Apr 1, 2026
Merged

Fix HtmlToDjot remaining serialization edge cases#174
dereuromark merged 1 commit intomasterfrom
feature/fix-html-to-djot-remaining-serialization

Conversation

@dereuromark
Copy link
Copy Markdown
Contributor

Summary

  • keep block-content table cells valid by degrading them to single-line cell text instead of emitting malformed Djot tables
  • preserve multiline footnote definitions through cleanup so later paragraphs stay inside the footnote body
  • escape problematic link labels and fall back to raw inline HTML for images that cannot be represented safely in Djot labels
  • raw-fall back the entire anchor when a linked image would otherwise be broken by label escaping

Testing

  • vendor/bin/phpunit tests/TestCase/Converter/HtmlToDjotTest.php
  • vendor/bin/phpunit tests/TestCase/Converter/HtmlToDjotTest.php tests/TestCase/RoundTripTest.php tests/TestCase/DjotConverterTest.php tests/TestCase/ProfileTest.php
  • vendor/bin/phpstan analyse src --no-progress
  • composer cs-check
  • vendor/bin/phpunit

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 98.11321% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 93.68%. Comparing base (59a5e5f) to head (00a91c0).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/Converter/HtmlToDjot.php 98.11% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #174      +/-   ##
============================================
+ Coverage     93.66%   93.68%   +0.02%     
- Complexity     3201     3220      +19     
============================================
  Files            93       93              
  Lines          8125     8171      +46     
============================================
+ Hits           7610     7655      +45     
- Misses          515      516       +1     

☔ View full report in Codecov by Sentry.
📢 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 e17f382 into master Apr 1, 2026
6 checks passed
@dereuromark dereuromark deleted the feature/fix-html-to-djot-remaining-serialization branch April 1, 2026 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant