Add line block and raw inline round-trip support#158
Merged
dereuromark merged 3 commits intomasterfrom Apr 1, 2026
Merged
Conversation
Adds round-trip support for line blocks (`| Line` syntax) by detecting `div.line-block` in HtmlToDjot and converting back to pipe-prefixed lines. - Add processLineBlock() to detect and convert div.line-block elements - Add extractLineBlockLines() to parse br-separated content - Add 3 round-trip tests for line blocks (simple, with formatting, with attributes) - Update converters.md documentation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #158 +/- ##
============================================
+ Coverage 93.74% 93.78% +0.04%
- Complexity 2980 3007 +27
============================================
Files 92 92
Lines 7691 7758 +67
============================================
+ Hits 7210 7276 +66
- Misses 481 482 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Adds round-trip support for raw inline content (`\`content\`{=format}` syntax)
by wrapping in a span with data-djot-raw attribute.
- Modify HtmlRenderer.renderRawInline() to wrap content in span with data-djot-raw
- Add processRawInline() and getInnerHtml() to HtmlToDjot
- Add 3 round-trip tests for raw inline (HTML, complex HTML, non-HTML format)
- Update Round-Trip Limitations documentation with escaped chars and abbreviations
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.
Summary
Adds round-trip support for:
| Linesyntax) - detectsdiv.line-blockand converts back to pipe-prefixed lines`content`{=format}syntax) - wraps in span withdata-djot-rawattributeLine blocks
processLineBlock()to detect and convertdiv.line-blockelementsextractLineBlockLines()to parse<br>-separated contentRaw inline
HtmlRenderer.renderRawInline()to wrap content in span withdata-djot-rawprocessRawInline()andgetInnerHtml()to HtmlToDjotThis is a follow-up to #157 which added extended round-trip support for other elements.