mdx-formatter

Type to search...

to open search from anywhere

Lists

How the formatter normalizes list indentation and spacing

The formatter normalizes list indentation. Spacing around lists is preserved as-is.

Rules

  • List markers (-, *, +, 1.) are preserved as-is
  • Leading spaces on top-level list items are removed
  • Nested lists are indented consistently

Examples

Remove leading spaces

Before:

  - First item
  - Second item
  - Third item

After:

- First item
- Second item
- Third item

Nested lists

Before:

  - Parent item
    - Nested item 1
    - Nested item 2
  - Another parent

After:

- Parent item
  - Nested item 1
  - Nested item 2
- Another parent

Numbered lists

Before:

  1. First item
  2. Second item
  3. Third item

After:

1. First item
2. Second item
3. Third item

Revision History