Raw inline HTML is a fragment of HTML passed through unchanged within a paragraph or other inline context. It allows authors to use HTML elements that have no Markdown equivalent — such as <abbr>, <kbd>, <sub>, or <sup> — without switching to a full HTML block.
Press <kbd>Ctrl</kbd>+<kbd>S</kbd> to save.
The term <abbr title="HyperText Markup Language">HTML</abbr> was coined in the early 1990s.
Press Ctrl+S to save.
The term HTML was coined in the early 1990s.
Best Practice
- Use inline HTML only for elements that Markdown cannot express —
<abbr>,<kbd>,<sup>,<sub>,<cite>, and similar semantic tags. - Keep inline HTML fragments short; lengthy HTML inside a paragraph should be moved to a block-level HTML block instead.
- Be aware that sanitised environments (GitHub comments, some CMS platforms) strip or escape inline HTML to prevent cross-site scripting (XSS).
Notes
Markdown Processing Around Inline HTML
Unlike HTML blocks, inline HTML in a paragraph does not suppress Markdown processing of the surrounding content. Emphasis, links, and other inline elements outside the HTML tags continue to render normally:
This is **bold** and <kbd>Escape</kbd> is a keyboard key — both render correctly.
Inline HTML vs HTML Block
Inline HTML is part of a paragraph; it does not interrupt the paragraph flow. Block-level elements like <div> or <table>, when placed on a line of their own, typically trigger an HTML block instead. See the HTML Block page for details.
Sanitisation
In environments where user-generated content is rendered, inline HTML is often sanitised. Safe semantic elements like <kbd> and <abbr> are usually allowed; elements that carry scripting risk such as <script> or event attributes are typically stripped.
Markdown Flavour Support
Broadly supported, but sanitisation behaviour varies by renderer and context.
Flavour Support Detail
| Flavour | Support | Notes |
|---|---|---|
| Original Markdown | Yes | HTML pass-through in inline contexts defined in the original spec. |
| CommonMark | Yes | Precisely specifies which HTML tags form inline HTML vs HTML blocks. |
| GitHub Flavored Markdown | Partial | Supported in .md files; sanitised in comments and wikis. |
| Pandoc Markdown | Yes | Passed through to HTML output; converted or stripped for other formats. |
Practical Examples
- Marking an abbreviation in an article: Use
<abbr>to give the full form of an acronym as a tooltip — Markdown has no native equivalent.
The event is organised by the <abbr title="Parent Teacher Association">PTA</abbr> and open to all families.
The event is organised by the PTA and open to all families.
- Showing a keyboard shortcut in a tutorial:
<kbd>is the semantic HTML element for keyboard input and makes shortcuts stand out clearly in how-to content.
Once you have finished editing, press <kbd>Esc</kbd> to close the panel, then click Save.
Once you have finished editing, press Esc to close the panel, then click Save.
- Adding a superscript reference in a recipe: Superscript numbers link a method note to a clarification at the bottom of the page when your flavour does not support footnotes natively.
Add the clarified butter<sup>1</sup> to the pan over a medium heat.
Add the clarified butter1 to the pan over a medium heat.