TOP011 - Heading indentation

September 16, 2025 ยท View on GitHub

Tags: headings, indentation

Aliases: heading-indentation

Fixable via script: Adjusts heading indentation level accordingly

This rule is triggered when a heading's indentation level is not correct. All headings must not be indented unless they are a heading for a note box, in which case they must match the note box's indentation level exactly.

### A normal heading must not be indented

  ### Indenting a non-note box heading will flag a TOP011 error

       #### Regardless of heading level

<div class="lesson-note" markdown="1">

#### If the note box is not indented, the heading must not be indented

</div>

   <div class="lesson-note" markdown="1">

   #### 3-space-indented note box? Heading needs 3 spaces

   </div>

   <div class="lesson-note" markdown="1">

     #### Mismatched indentation will flag a TOP011 error

   </div>

Rationale

Normally, markdown headings must not be indented else parsers typically do not parse them as headings. However, The Odin Project's website's markdown converter can register indented headings, and will only register a heading as belonging to a note box if it matches its indentation level.

Therefore, this rule overwrites the built-in MD023 rule to allow for this exception.