Skip to content

Add HTML→Djot enhancements: attribution, wrapper unwrap, MathML#165

Merged
dereuromark merged 1 commit intomasterfrom
feature/html-to-djot-enhancements
Apr 1, 2026
Merged

Add HTML→Djot enhancements: attribution, wrapper unwrap, MathML#165
dereuromark merged 1 commit intomasterfrom
feature/html-to-djot-enhancements

Conversation

@dereuromark
Copy link
Copy Markdown
Contributor

Summary

Enhances the HTML→Djot converter with three new features inspired by Pandoc's capabilities:

  • Blockquote attribution: Extracts <footer> or <cite> elements from blockquotes and converts them to Djot's quoted attribution format (adds a blank > line followed by the attribution text)
  • Wrapper div unwrapping: When a div with attributes contains a single block child, applies the attributes directly to the child instead of creating a fenced div
  • MathML conversion: Converts <math> elements to Djot math syntax by extracting LaTeX from alttext attribute, <annotation> element with tex/latex encoding, or text content fallback

All features include comprehensive tests.

- Blockquote attribution: Extract footer/cite elements as quoted attribution
- Wrapper div unwrapping: Apply attrs to single block child instead of fenced div
- MathML conversion: Extract LaTeX from alttext, annotation, or text content
@dereuromark dereuromark force-pushed the feature/html-to-djot-enhancements branch from 6f86385 to 54ba8f1 Compare April 1, 2026 18:39
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 98.30508% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 93.94%. Comparing base (c7941ca) to head (54ba8f1).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/Converter/HtmlToDjot.php 98.30% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #165      +/-   ##
============================================
+ Coverage     93.91%   93.94%   +0.03%     
- Complexity     3075     3106      +31     
============================================
  Files            93       93              
  Lines          7891     7950      +59     
============================================
+ Hits           7411     7469      +58     
- Misses          480      481       +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 53588fb into master Apr 1, 2026
6 checks passed
@dereuromark dereuromark deleted the feature/html-to-djot-enhancements branch April 1, 2026 19:25
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