| id | 178 |
|---|---|
| title | List marker space rule |
| status | ✅ |
| model | sonnet |
| depends-on | |
| summary | New rule MDS061 (provisional) for markdownlint MD030 list-marker-space — the number of spaces between a list marker and the item text, configurable per single-line vs multi-line and ordered vs unordered. Autofix normalizes the gap. |
Enforce a consistent gap between a list marker (-, *,
+, 1.) and the item text. This closes the MD030 gap
from the
linter comparison.
markdownlint MD030 has four knobs: spaces after the marker
for single-line vs multi-paragraph items, each split by
ordered vs unordered. The default is one space everywhere.
goldmark exposes *ast.List and *ast.ListItem; the
marker run and following spaces are read from the item's
source segment.
-
Rule ID: MDS061 (provisional), category
style, default-enabled with one space everywhere. -
Config mirrors markdownlint:
rules: list-marker-space: ul-single: 1 ul-multi: 1 ol-single: 1 ol-multi: 1
-
An item is "multi" when it contains more than one block child (matching markdownlint's loose/tight definition).
-
Autofix rewrites the inter-marker whitespace to the configured count; list indentation is left to MDS016.
- Scaffold
internal/rules/listmarkerspace/. - Implement marker/space measurement per list item.
- Implement
rule.Configurablefor the four keys (replace-mode scalars; document inApplySettings). - Implement the autofix and loop-stability test.
- Fixture tests under the provisional
internal/rules/MDS061-*directory. - Rule README; regenerate the docs catalog and index.
- Add the MD030 row to the linter comparison.
-
- item(two spaces) is flagged and fixed to- itemunder the default config. - A multi-paragraph item honors
ul-multiwhen it differs fromul-single. - Ordered and unordered lists use their own knobs.
- Nested lists are measured per level, not flattened.
- All tests pass:
go test ./... -
go tool golangci-lint runreports no issues -
mdsmith check .passes