Skip to content

Add nestedListsWithoutBlankLine lever; make blocksInterruptParagraphs interrupt consistently in lists#207

Merged
dereuromark merged 10 commits into
masterfrom
feature/nested-lists-without-blank-line
Jun 3, 2026
Merged

Add nestedListsWithoutBlankLine lever; make blocksInterruptParagraphs interrupt consistently in lists#207
dereuromark merged 10 commits into
masterfrom
feature/nested-lists-without-blank-line

Conversation

@dereuromark
Copy link
Copy Markdown
Contributor

Summary

Adds two composable, opt-in list-nesting levers and deprecates the broad one, so paragraph interruption behaves the same at the top level and inside list items.

  • New nestedListsWithoutBlankLine lever: a sublist nests inside a list item without a blank line (markdown-style compact lists). Nothing else nests. Available as a constructor flag, setNestedListsWithoutBlankLine(), and DjotConverter::withNestedListsWithoutBlankLine().
  • blocksInterruptParagraphs made consistent: it now also interrupts a list item's lead paragraph, so an indented non-list block nests inside the item, using the same lone-marker lookahead as the top level. Unambiguous openers (#, fenced code, :::, ---) and real multi-line blocks nest; an ambiguous single-line marker (> comparison, |) stays literal. A lone > 5 indented under a list item now behaves exactly like it does at the top level.
  • significantNewlines redefined: now equivalent to blocksInterruptParagraphs + nestedListsWithoutBlankLine, and deprecated. The broad nestedBlocksInLists is also deprecated (kept working, unchanged eager nesting).

All levers are opt-in; no default behavior changes.

Implementation

  • A single gate BlockParser::allowsImmediateNestedBlock() drives both in-list nesting sites; the interrupt branch routes through the existing startsNewBlockSignificant() lookahead so in-list and top-level interruption share one rule.
  • Docs updated to match: parser-options guide (new mode section + comparison tables), API reference, enhancements (optional-modes now lead with the granular levers), and the syntax guide.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.87%. Comparing base (a46d0a6) to head (547aa13).

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #207      +/-   ##
============================================
+ Coverage     91.82%   91.87%   +0.04%     
- Complexity     3458     3470      +12     
============================================
  Files           104      104              
  Lines          9799     9829      +30     
============================================
+ Hits           8998     9030      +32     
+ Misses          801      799       -2     

☔ 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 added the enhancement New feature or request label Jun 3, 2026
@dereuromark dereuromark merged commit 72200ec into master Jun 3, 2026
6 checks passed
@dereuromark dereuromark deleted the feature/nested-lists-without-blank-line branch June 3, 2026 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant