MD033 - no-inline-html¶
Description¶
This rule detects the use of raw HTML elements within Markdown content. HTML elements in code blocks and HTML comments are not flagged.
Rationale¶
Raw HTML in Markdown documents may not render correctly in all Markdown parsers and can cause issues when converting to non-HTML formats. Using native Markdown syntax ensures better portability and consistency.
Configuration¶
allowed_elements-
List of HTML element names that are allowed.
- Default:
[](empty)
- Default:
table_allowed_elements-
List of HTML element names allowed in tables. Falls back to allowed_elements if not set.
- Default:
none
- Default:
Examples¶
Invalid¶
# Invalid Document
<div>This is inline HTML</div>
Some text with <span>inline HTML</span> inside.
<p>A paragraph using HTML</p>
Valid¶
# Valid Markdown
This is a paragraph with **bold** and *italic* text.
- List item one
- List item two
```html
<div>Code blocks are allowed</div>
```