doc: clarify that a sublist needs a blank line#400
Open
dereuromark wants to merge 1 commit into
Open
Conversation
The List item section shows lazy continuation but never the consequence of the global rule (Block syntax) that a paragraph can never be interrupted: an indented list marker directly after paragraph text folds in as lazy continuation rather than starting a sublist. Add a short example contrasting the no-blank-line case (single item) with the blank-line case (nested sublist), since the connection between the two sections is easy to miss. Edits doc/syntax.md only; doc/syntax.html is regenerated from it via make.
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.
Problem
The behavior is fully specified, but split across two distant sections, and the connection is easy to miss.
The Block syntax preamble states the governing rule:
The List item section, however, only describes lazy continuation and says an item is "one or more lines, indented relative to the list marker." A reader there naturally expects
to nest. It does not: because the indented
- bwould interrupt the open paragrapha, it folds in as lazy continuation, so this is a single-item list. A blank line is required to nest:This trips up newcomers (and is a common point of confusion when comparing djot to Markdown/CommonMark, where the first form nests).
Change
Add a short example to the List item section that makes the consequence of the non-interruption rule explicit, contrasting the no-blank-line case (single item) with the blank-line case (nested sublist), and pointing back to the Block syntax rule.
Verified against the reference (djot.js 0.3.2):
- a/- bproduces one<li>containing the paragraph.- a/ blank /- bproduces a nested<ul>.Docs only: edits
doc/syntax.md;doc/syntax.htmlis regenerated from it via themakerule (not committed here). Opened as a draft for your review of wording and placement.