Nested Markdown lists depend on precise indentation rather than a fixed number of spaces, and understanding how list markers determine that alignment prevents flattened bullets and a broken document hierarchy. Learn more at https://markdowntoolsonline.com/
Nested lists are one of the more common places where Markdown breaks silently, since indentation is easy to misjudge and hard to verify by reading raw text alone. A document can look correctly structured in a plain text editor and still render with flattened bullets or an unexpected code block once processed. Understanding how Markdown determines nesting, rather than relying on a memorized number of spaces, removes most of the guesswork.
Many people learn to indent nested lists by four spaces, a habit tracing back to the original Markdown dot P L implementation, where every level of nesting used a flat indent regardless of context. CommonMark and GitHub Flavored Markdown, the specifications most parsers follow, work differently.
A nested item is recognized as a child when its marker aligns with the first character of text following the parent item's marker, not when a specific number of spaces has been counted. Four spaces works in many cases but is not the actual mechanism, which is why nesting sometimes behaves inconsistently across tools.
The required indentation depends on how wide the parent marker is. A hyphen marker followed by a space is two characters wide, so a child item needs only two spaces to align correctly. An ordered marker like the number one followed by a period and a space is three characters wide, requiring three spaces for a nested item beneath it. Once a list reaches double digits, a marker like the number ten followed by a period becomes four characters wide, pushing the indentation to four spaces. This is why a document can nest correctly early in a numbered list and appear to break once numbering passes nine.
Experts from Markdown Tools Online note that indenting every nested item by four spaces remains common and generally safe, since it satisfies alignment for most markers at once. The exception worth knowing is that four spaces outside a list context is the syntax for an indented code block. If a list item is copied or restructured in a way that separates it from its parent, four-space children can suddenly render as a code block instead of a list. Two-space indentation for unordered lists avoids this, though it needs more attention when mixing marker types.
Lists that combine ordered and unordered items at different levels need indentation calculated independently at each level, since each parent marker has its own width. A numbered top-level item followed by a bulleted sublist bases its indentation on the numbered marker's width, while an item nested beneath that sublist calculates its own indentation from the bullet marker above it. Treating each level as its own alignment problem keeps deeper hierarchies from drifting out of alignment as they grow.
Several habits introduce nesting errors that are hard to spot by reading raw text. Mixing tabs and spaces within the same list is one of the most frequent causes, since a tab renders at a different width depending on the editor and parser involved. Inconsistent indentation between sibling items, even by a single space, can cause a parser to treat one item as a continuation of the paragraph above it rather than a new list entry. Some editors also apply automatic indentation that does not match Markdown's alignment rules.
Because indentation errors rarely produce a visible error message, a list can look correct in the source text while rendering incorrectly once processed. The most reliable way to catch this is to preview the document before publishing, particularly when a list is nested more than two levels deep or mixes ordered and unordered items. Checking rendered output against the intended structure takes only a moment and catches silent flattening that is otherwise easy to miss.
Click the link in the description to learn more. Vidranya City: Chennai Address: 9b sis Meridian West block Website: https://vidranya.com Email: dharannagu@gmail.com