Repository navigation
Continue a definition term on the lines below it - #313
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
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
force-pushed
the
fix/definition-term-continuation
branch
from
October 16, 2026 13:52
dfa9d4d to
11390c4
Compare
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.
A definition term now continues on the lines below it until a blank line, as in djot.js
9790d4d.djot.js:
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,tailgave<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:
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.HtmlToDjotalready 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
: termlines still share one definition, a djot-php extension; djot.js gives each its own empty definition.