Skip to content

Continue a definition term on the lines below it - #313

Merged
dereuromark merged 1 commit into
masterfrom
fix/definition-term-continuation
Oct 16, 2026
Merged

dereuromark merged 1 commit into
masterfrom
fix/definition-term-continuation

Conversation

@dereuromark

@dereuromark dereuromark commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

A definition term now continues on the lines below it until a blank line, as in djot.js 9790d4d.

: t
tail

djot.js:

<dl>
<dt>t
tail</dt>
<dd>
</dd>
</dl>

djot-php before: <dt>t</dt>, then <p>tail</p> after the list. A line indented by two or more spaces started the definition instead (: t, tail gave <dd><p>tail</p></dd>). Only a one-space line continued the term.

The syntax description: "the first line or lines after the : marker is parsed as inline content and taken to be the term defined." Its examples always put a blank line between the term and the definition.

What can break

A definition written directly under its term, without a blank line:

: Term
  Definition of the term.

That is now one term, "Term Definition of the term.", with an empty definition, which is also how djot.js reads it. Two docs examples (why-djot.md, the ANSI cookbook) were written this way and get the blank line. HtmlToDjot already writes the blank line, so converted documents are unaffected. A term attribute line ({.c} at column 0 under the term) still attaches to the term.

Measured against djot.js

No change on the 4853 generated block-family inputs (1077 before and after, on top of #312): none of them has a non-blank line right after a term once the other differences are counted. The about 115 cases the earlier analysis put in this family were minimized forms in which the blank line had been deleted.

Not changed: consecutive : term lines still share one definition, a djot-php extension; djot.js gives each its own empty definition.

@dereuromark dereuromark added bug Something isn't working bc-breaking labels Oct 16, 2026
@codecov

codecov Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.07%. Comparing base (5d29dce) to head (11390c4).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #313   +/-   ##
=========================================
  Coverage     93.06%   93.07%           
- Complexity     4729     4732    +3     
=========================================
  Files           118      118           
  Lines         12635    12636    +1     
=========================================
+ Hits          11759    11761    +2     
+ Misses          876      875    -1     

☔ 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.

A term took only lines indented by exactly one space. A line indented by
two or more started the definition, and an unindented line ended the list:
`: t` followed by `tail` gave `<dt>t</dt>` and a paragraph after the list.
djot.js parses the term as a paragraph, as the syntax description says: "the
first line or lines after the `:` marker is parsed as inline content and
taken to be the term defined". So the term runs to the next blank line, and
an unindented line ends it only when it opens a block.

This changes documents that put the definition directly under the term
without a blank line: the definition now becomes part of the term. The two
docs examples written that way get the blank line, and the source line test
uses it too.
@dereuromark
dereuromark force-pushed the fix/definition-term-continuation branch from dfa9d4d to 11390c4 Compare October 16, 2026 13:52
@dereuromark
dereuromark merged commit b038fb5 into master Oct 16, 2026
4 checks passed
@dereuromark
dereuromark deleted the fix/definition-term-continuation branch October 16, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bc-breaking bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant