An open source design system that's fully customizable and agent ready
TypeScript
docs(spec): AST-061 list markers cycle by depth (#7010)
Cindy Zhang9012937030ba
diff --git a/docs/specs/AST-061-document-surface-parity/spec.md b/docs/specs/AST-061-document-surface-parity/spec.mdindex d5dacc3f55..e8bfee832d 100644--- a/docs/specs/AST-061-document-surface-parity/spec.md+++ b/docs/specs/AST-061-document-surface-parity/spec.md@@ -73,8 +73,8 @@ reflows no line; only editing affordances appear or disappear.- **FR5 — Same structure.** Paragraph soft line breaks join into one line offlowing text; hard breaks break. A blockquote's lines continue oneparagraph. Ordered and unordered lists nest by CommonMark indentation, show- one marker per item with the marker style of its depth, and indent each- level by the same amount. Task-list items, fenced code, tables, and+ one marker per item with the marker style of its depth (DEC-6), and indent+ each level by the same amount. Task-list items, fenced code, tables, andthematic breaks render as those structures, never as their literal source.- **FR6 — Same direction.** Content blocks lay out in the direction of thesurrounding Internationalization provider on every surface. A surface does@@ -123,18 +123,21 @@ constructs they render, and their default editor theme follows FR2 and FR3.`@astryxdesign/core/Markdown/parser` and `@astryxdesign/core/Markdown` export`decodeMarkdownCharacterReferences`, the DEC-5 decoder the RichText surfacesimport with.+`Markdown` draws disc and decimal markers at every depth, and RichText draws+the second bulleted level as a disc; both adopt the DEC-6 marker cycle.## Verification-| Contract | Verification | Representative states | Mutation or failure expectation |-| ---------- | ----------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |-| FR2–FR4 | Real-browser computed style and block geometry of the parity fixture on `Markdown` and RichText | 390px and 1440px; light and dark; default density | Restoring a hard-coded heading size or a different block margin moves a block past 2 px and fails |-| FR5 | Real-browser structure and line counts of the parity fixture | Nested lists at 2- and 3-space indentation; soft breaks; blockquote continuation | Flattening a nested list or turning a soft break into a line break fails |-| FR6 | Real-browser computed direction per block | Right-to-left provider with left-to-right text, and the reverse | Per-block automatic direction fails |-| FR7 | Semantic DOM of inline marks, links, and character references on every surface | Titled link, bare link, strong, emphasis, strikethrough; `&`, `©`, `©` in text and in code | A title inside a destination, a styled span in place of a semantic element, or an undecoded reference in text fails |-| FR7, DEC-5 | Shared conformance cases through `Markdown` rendering and RichText import | Named, decimal, and hexadecimal references; an unknown name; a missing semicolon; an invalid code point | A second reference table, or a decoder that changes an unknown name or an unterminated reference, fails |-| FR8 | Real-browser code block header geometry in both modes | Fenced code with an info string | A header missing from one mode moves the code and fails |-| FR9–FR10 | Real-browser read/edit switch of the parity fixture and a long document | Short document at the top; long document halfway down | A per-block shift beyond the constant offset, or an anchor block leaving the top of the view, fails |+| Contract | Verification | Representative states | Mutation or failure expectation |+| ---------- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |+| FR2–FR4 | Real-browser computed style and block geometry of the parity fixture on `Markdown` and RichText | 390px and 1440px; light and dark; default density | Restoring a hard-coded heading size or a different block margin moves a block past 2 px and fails |+| FR5 | Real-browser structure and line counts of the parity fixture | Nested lists at 2- and 3-space indentation; soft breaks; blockquote continuation | Flattening a nested list or turning a soft break into a line break fails |+| FR6 | Real-browser computed direction per block | Right-to-left provider with left-to-right text, and the reverse | Per-block automatic direction fails |+| FR7 | Semantic DOM of inline marks, links, and character references on every surface | Titled link, bare link, strong, emphasis, strikethrough; `&`, `©`, `©` in text and in code | A title inside a destination, a styled span in place of a semantic element, or an undecoded reference in text fails |+| FR7, DEC-5 | Shared conformance cases through `Markdown` rendering and RichText import | Named, decimal, and hexadecimal references; an unknown name; a missing semicolon; an invalid code point | A second reference table, or a decoder that changes an unknown name or an unterminated reference, fails |+| FR5, DEC-6 | Real-browser marker style per depth on both surfaces | Bulleted and numbered lists nested 0–8 deep and of mixed types; starts of 0, −1, 26, 27, 3999, and 4000 at alpha and roman depths; right-to-left; light and dark | A level that draws another level's marker, or one surface differing from the other, fails |+| FR8 | Real-browser code block header geometry in both modes | Fenced code with an info string | A header missing from one mode moves the code and fails |+| FR9–FR10 | Real-browser read/edit switch of the parity fixture and a long document | Short document at the top; long document halfway down | A per-block shift beyond the constant offset, or an anchor block leaving the top of the view, fails |## Decision log@@ -201,6 +204,26 @@ This is the narrow exception to this record's non-goals on import mechanismand equivalent internals; every other internal stays free, and no generalHTML entity utility is exported.+### DEC-6 — List markers cycle by depth++**Reference:** `spec:AST-061/DEC-6`+**Decider:** cixzhang, 2026-10-06++A list's depth is the number of lists, bulleted or numbered, that enclose it;+a top-level list has depth 0. A bulleted list draws disc, circle, or square+markers when its depth modulo 3 is 0, 1, or 2; a numbered list writes its+numbers as decimal, lower-alpha, or lower-roman the same way. The cycle+repeats without end, so each level differs from the levels beside it and a+reader can tell depth apart on every surface. Numbering keeps the list's+start value and counts the same items; only how each number is written+changes. Letters past `z` continue as `aa`, `ab`, and so on. A number outside+its style's range — zero or a negative number under lower-alpha or+lower-roman, as a start of 0 or below gives, or a number past 3999 under+lower-roman — is written in decimal, as the CSS counter styles fall back; the+start value and the items stay as written. Task list items show checkboxes+instead of markers. Markers are presentation: the+list keeps its list semantics, and the source does not change.+## Open questions- None.diff --git a/packages/core/src/Markdown/Markdown.spec.md b/packages/core/src/Markdown/Markdown.spec.mdindex 4e61ac8766..314c3d08e7 100644--- a/packages/core/src/Markdown/Markdown.spec.md+++ b/packages/core/src/Markdown/Markdown.spec.md@@ -48,6 +48,7 @@ system_specs:spec:AST-036/DEC-3,spec:AST-036/DEC-4,spec:AST-061/DEC-5,+ spec:AST-061/DEC-6,]---@@ -227,7 +228,8 @@ text. Outside a table cell, inline code retains its authored backslashes.- **AV1 — Parsed content.** The number and ordering of block parts may vary withthe Markdown source without changing their ownership.- **AV2 — Lists.** Ordered, unordered, and task lists share the List anatomy and- current `markdown-list` target.+ current `markdown-list` target. Each level's marker style is fixed by its+ depth, as `spec:AST-061/DEC-6` defines, not a variation.- **AV3 — Custom renderers.** Supported custom block renderers may replace theirdefault part and own its styling without receiving a Markdown block target.- **AV4 — Nested primitives.** Astryx primitives used inside default blocks may@@ -247,7 +249,7 @@ text. Outside a table cell, inline code retains its authored backslashes.| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- || Default block content | Every parsed block uses its corresponding current Markdown target. | Block count, order, density, content width, and alignment. || Custom block renderers | The replaced Heading, Paragraph, Code block, Blockquote, Divider, or Image lacks the corresponding Markdown target. | Replacement structure and styling. |-| Ordered/unordered list | List carries `markdown-list`. | Marker kind, start value, item count, and nested content. |+| Ordered/unordered list | List carries `markdown-list`; each level's marker style follows its depth (`spec:AST-061/DEC-6`). | Start value, item count, and nested content. || Task list | Each task-marked item carries its own checked state; mixed task/plain items stay in one compatible list and preserve document order and nesting. | Checked values, item content, and adjacent plain items. || Safe block image | Default Image carries `markdown-image`, or a custom image renderer replaces it. | Source and alternative text. || Unsafe block image URL | Markdown renders its fallback Image part with `markdown-image`; no custom image renderer receives the rejected URL. | Alternative text shown by the fallback. |