# Fix Markdown nested lists without guessing indentation

Canonical: https://githtml.com/guides/markdown-nested-list-indentation
Published: 2026-11-23
Publisher: WaveTech LLC / gitHtml

Align nested content with the text of its parent item, then preview the complete list rather than a single line. The width of the parent marker matters, especially after item nine. Use consistent spaces and keep explanations attached to the correct step so indentation communicates responsibility as well as appearance.

## Find where the hierarchy becomes ambiguous

Start at the first child item that appears at the wrong level. Compare its indentation with the first text character of the parent, not simply with the dash or digit. A list can look convincing in a proportional editor while containing inconsistent spaces. Turn on whitespace display temporarily or inspect the source in a monospaced view. Write down the intended relationship in plain language: configure the service, then configure its timeout and retry policy. If the child is actually the next independent task, promote it instead of forcing the renderer to display a deeper hierarchy.

## Use a representative list rather than an isolated bullet

The sample uses numbered parent steps and subordinate checks. Add a second paragraph to one parent and a fenced example to another before declaring the convention settled. Real documentation fails at these boundaries more often than at a simple pair of bullets. Test a two-digit step number if the procedure is long. Avoid replacing spaces with tabs merely because a local editor makes them align; tab display preferences vary between readers. When a formatter rewrites the list, inspect the rendered result and preserve the hierarchy, not a specific visual arrangement of whitespace in the raw file.

````markdown
1. Prepare the sample service.
   - Choose a test workspace.
   - Record the current configuration.
2. Validate the result.
   - Compare the observed output with the example.
````

## Keep procedure structure readable after repair

A deeply nested list can be technically valid and still be difficult to execute. If readers must track several branches while performing a task, split alternatives under descriptive subheadings. Reserve nested bullets for supporting details that belong to the same action. Read the finished list aloud: each parent should remain meaningful without its children, and each child should have an obvious parent. Check both the repository preview and any exported documentation because processors may support different extensions. Capture the failing and corrected examples in a small authoring note so the next contributor does not repeat the indentation experiment. Preserve the original sequence while repairing syntax. Reordering steps to make indentation easier can accidentally change the procedure; treat any such change as a separate editorial decision requiring a subject-matter review.

1. Mark the intended parent for every child before editing spaces.
2. Preview a continuation paragraph and code example inside the list, not only the bullet markers.
3. Check that a reader can distinguish required actions from optional explanations without relying on indentation alone.

## Sources and further reading

- [GitHub Docs: Basic writing and formatting syntax](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax)
- [CommonMark specification](https://spec.commonmark.org/0.31.2/)

## Related guides

- [Control Markdown ordered lists without relying on typed numbers](https://githtml.com/guides/markdown-ordered-list-renumbering)
- [Why Markdown inside an HTML block stops formatting](https://githtml.com/guides/markdown-raw-html-block-boundaries)
- [Maintain repeated Markdown images with reference labels](https://githtml.com/guides/markdown-reference-style-images)
- [Use reference-style Markdown links without broken labels](https://githtml.com/guides/markdown-reference-style-links)

Editorial approach: https://githtml.com/guides/about
