Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@dereuromark
Copy link
Contributor

Summary

Fixes HtmlToDjot to output valid Djot syntax for definition lists that can roundtrip correctly.

Before (broken)

<dl><dt>Term</dt><dd>Definition</dd></dl>

Converted to:

Term
: Definition

This is not valid Djot - the term needs : prefix and definition needs indentation.

After (fixed)

: Term

  Definition

This roundtrips correctly back to:

<dl><dt>Term</dt><dd><p>Definition</p></dd></dl>

Multiple terms support

<dl><dt>color</dt><dt>colour</dt><dd>The visual property.</dd></dl>

Converts to:

: color
: colour

  The visual property.

Test plan

  • Single term + definition roundtrips
  • Multiple terms sharing one definition roundtrips
  • All existing tests pass (1032 tests)

- Use ': term' format for dt elements (not bare text)
- Use indented content for dd elements (2 spaces)
- Preserve indentation in cleanup() for definition content
- Support multiple dt terms sharing one dd definition
- Add test for multiple terms case

The previous output was not valid Djot and failed to roundtrip correctly.
@codecov
Copy link

codecov bot commented Dec 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.56%. Comparing base (ecd1022) to head (43115e9).
⚠️ Report is 11 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master      #31      +/-   ##
============================================
+ Coverage     93.54%   93.56%   +0.02%     
- Complexity     1705     1723      +18     
============================================
  Files            65       65              
  Lines          4446     4508      +62     
============================================
+ Hits           4159     4218      +59     
- Misses          287      290       +3     

☔ 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 f16ea3a into master Dec 8, 2025
6 checks passed
@dereuromark dereuromark deleted the fix/htmltodjot-definition-list branch December 8, 2025 03:40
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.

2 participants