fix: list-item {.x} line no longer terminates the list#186
Merged
Conversation
added 3 commits
May 20, 2026 01:41
Adds failing tests describing the target rule: a {...} line on an
indented continuation attaches to the <li> only when it is the last
content line of the item. If another block follows it in the same
item, the {...} reverts to a standard djot block-attribute for that
following block and the list is NOT terminated.
Two regression guards (last-line and blank-line/loose) already pass.
The three new mid-item continuation tests fail against current master
and will be made green in the next commit.
Previously, a postfix {.x} line inside a list item silently
terminated the list-item / list, causing any following indented
content (blockquote, paragraph continuation, nested list) to escape
into a sibling paragraph outside the list.
Now: a {...} line attaches to the <li> only when it is the last
content line of the item. If another block follows it within the
same item, the {...} reverts to a standard djot block attribute for
that following block and the list / item remain intact.
Also tightens the nested-list test assertion to reflect that the
nested <ul> now correctly picks up the pushed-back block attribute.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #186 +/- ##
============================================
+ Coverage 91.10% 91.11% +0.01%
- Complexity 3321 3331 +10
============================================
Files 99 99
Lines 8497 8521 +24
============================================
+ Hits 7741 7764 +23
- Misses 756 757 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This was referenced May 20, 2026
dereuromark
added a commit
that referenced
this pull request
May 20, 2026
Documents the governing principle ("attributes precede their target;
adjacency selects the tighter target where supported") and a single
table covering all djot-php attribute targets (block, inline, <li>,
<dt>, <dd>, <dl>, table row, table cell, marker-glyph not-addressable
note). Notes the start/type/reversed strip on <li>/<dd> (#187) and
the list-item last-content-line rule (#186).
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
Fixes a bug where a postfix
{...}line inside a list item silently terminated the list, causing any following indented content (blockquote, paragraph continuation, nested list) to escape into a sibling paragraph outside the list.New rule
A standalone
{...}line on an indented continuation attaches to the<li>only when it is the last content line of the item. If another block follows within the same item, the{...}reverts to a standard djot block attribute for that following block; the list / item are not terminated.Before / after
Input:
Before:
After:
Tests
Five new test methods in
tests/TestCase/DjotConverterTest.phpcovering: blockquote-after-attr, paragraph-after-attr, nested-list-after-attr, last-line baseline regression guard, and loose-list (blank-line) regression guard.Docs
Updated
docs/reference/enhancements.mdanddocs/guide/syntax.mdto document the rule with a worked example.Related
Part of the attribute-hardening sweep. See sibling issue #185 tracking jgm/djot#262 (marker-adjacent syntax — out of scope here).