Rich Content Formatting
HTML Renderer Macro
HTML Renderer Macro
What It Does
The HTML Renderer macro renders custom HTML markup inside a Confluence page. It supports standard HTML elements, inline CSS, and safe embed codes - giving authors who know HTML direct control over layout and styling on specific sections of a page.
How to Use
- Insert the HTML Renderer macro
- Paste or type your HTML into the macro body
- The macro sanitizes the HTML and renders a preview in edit mode
- Publish the page - readers see the rendered HTML output
Supported HTML Elements
| Category | Supported Tags |
|---|---|
| Structure | div, section, article, header, footer, p, span |
| Headings | h1 – h6 |
| Text formatting | strong, em, u, s, code, pre, blockquote |
| Lists | ul, ol, li, dl, dt, dd |
| Tables | table, thead, tbody, tr, th, td |
| Media | img (src must be absolute URL), figure, figcaption |
| Links | a (href with http/https) |
| Inline style | style attribute on any element |
Sanitization Rules
For security, the following are stripped before rendering:
<script>tags and JavaScript event handlers (onclick,onload, etc.)<iframe>tags (use Confluence's native embed for iframes)- External stylesheet links (
<link rel="stylesheet">) <form>and<input>elements (use the Form Macro for input collection)data:andjavascript:URIs inhreforsrcattributes
Common Use Cases
- Custom layouts: Multi-column HTML layouts using flexbox or grid via inline CSS - useful when Confluence's column macro isn't flexible enough
- Styled callouts: Highly customized callout boxes that go beyond what the Alert macro offers
- Embedded badges or shields: Static SVG badges (e.g., build status, version number) from external badge services
- Complex tables: HTML tables with
colspan,rowspan, or cell-level background colors not possible in Confluence's native table editor - Third-party widget embeds: Static HTML embed codes from tools that provide non-iframe embeds (e.g., charts, maps with static HTML output)
Limitations
- JavaScript is not executed - HTML Renderer is for markup and styling only, not interactive widgets
<iframe>is blocked; use Confluence's built-in Embed macro for video and external content iframes- Inline styles apply only within the macro container - they cannot affect elements outside the macro body
- Very large HTML blocks may affect page load time; keep HTML concise