One of Markdown's most powerful architectural features is that it does not attempt to replace HTML. John Gruber explicitly designed Markdown as a writing format that seamlessly integrates with raw HTML tags whenever markdown syntax falls short.
If a feature cannot be expressed in Markdown (such as centering an image, creating a collapsible FAQ accordion, or displaying keyboard key caps), you can write raw HTML directly in your .md file!
Click to Zoom
Markdown Compilation Pipeline
1. The Raw HTML Rule in Markdown
Any raw HTML5 element placed inside a Markdown file is passed through directly to the compiled HTML output without modification:
4<strong>Notice:</strong> This styled callout box is created with raw HTML and CSS!
5</div>
Blank Line Rule (Block-Level HTML):
In CommonMark, block-level HTML tags (like <div>, <p>, <table>, or <section>) should be separated from surrounding Markdown paragraphs by blank lines to prevent parsing glitches.
2. High-Value HTML Tags for Technical Writers
1. Collapsible Accordions (<details> & <summary>)
Perfect for hiding long code snippets, spoilers, FAQ answers, or optional setup steps:
1<details>
2<summary><b>🔍 Click here to view the full database migration SQL</b></summary>
3
CREATE TABLE users ( id SERIAL PRIMARY KEY, username VARCHAR(50) NOT NULL UNIQUE );
1
2</details>
2. Keyboard Key Caps (<kbd>)
Display hotkeys and keyboard shortcuts cleanly:
1To open the command palette in VS Code, press <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd>.
(Renders key caps with distinct borders).
3. Highlighting Text (<mark>)
1The token expires in <mark>60 seconds</mark>.
4. Subscript & Superscript (<sub> & <sup>)
1Chemical Formula: H<sub>2</sub>O
2Einstein Equation: E = mc<sup>2</sup>
3. Embedding Audio & Video Media
Standard Markdown does not have native audio or video players. Use HTML5 media tags: