Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

MD007 - Unordered List Indentation

Unordered list indentation should use consistent spacing.

Why This Rule Exists

Proper indentation of nested lists ensures correct rendering and improves readability. Different Markdown parsers may interpret inconsistent indentation differently.

Examples

Incorrect (4-space indent when 2 expected)

- Item one
    - Nested too far
- Item two

Correct (2-space indent)

- Item one
  - Properly nested
  - Another nested item
- Item two

Correct (4-space indent with configuration)

- Item one
    - Nested with 4 spaces
    - Another nested item
- Item two

Configuration

[MD007]
indent = 2           # Spaces per indentation level (default: 2)
start_indented = false  # Allow first level to be indented
OptionDefaultDescription
indent2Number of spaces per nesting level
start_indentedfalseAllow top-level items to be indented

When to Disable

  • Documents following a different indentation standard
  • Content imported from tools using different conventions

Rule Details

  • Rule ID: MD007
  • Aliases: ul-indent
  • Category: Formatting
  • Severity: Warning
  • Auto-fix: Yes
  • MD004 - Unordered list style
  • MD005 - List item indentation consistency
  • MD006 - Lists start at beginning of line
  • MD029 - Ordered list prefix style