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

MD033 - No Inline HTML

Inline HTML should be avoided.

Why This Rule Exists

Markdown documents should remain portable and renderable in environments that don't support HTML. Raw HTML also makes documents harder to maintain and can introduce security concerns in some contexts.

Examples

Incorrect

<div class="warning">
This is a warning message.
</div>

Click <a href="https://example.com">here</a> for more.

<br>

<img src="image.png" alt="An image">

Correct

> **Warning**: This is a warning message.

Click [here](https://example.com) for more.

![An image](image.png)

Configuration

[MD033]
allowed_elements = []  # HTML elements to allow (default: none)

Allow Specific Elements

[MD033]
allowed_elements = ["br", "details", "summary"]

When to Disable

  • Documents requiring HTML features not in Markdown
  • Content using HTML for accessibility features
  • mdBook projects using HTML preprocessors

Rule Details

  • Rule ID: MD033
  • Aliases: no-inline-html
  • Category: Content
  • Severity: Warning
  • Auto-fix: No

Common Allowed Elements

ElementUse Case
brLine breaks within paragraphs
detailsCollapsible sections
summarySummary for details
kbdKeyboard input
sub, supSubscript/superscript
  • MD045 - Images should have alt text