Rich Content Formatting

HTML Renderer Macro

HTML Renderer Macro

HTML Renderer Macro screenshot

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

  1. Insert the HTML Renderer macro
  2. Paste or type your HTML into the macro body
  3. The macro sanitizes the HTML and renders a preview in edit mode
  4. Publish the page - readers see the rendered HTML output

Supported HTML Elements

CategorySupported Tags
Structurediv, section, article, header, footer, p, span
Headingsh1h6
Text formattingstrong, em, u, s, code, pre, blockquote
Listsul, ol, li, dl, dt, dd
Tablestable, thead, tbody, tr, th, td
Mediaimg (src must be absolute URL), figure, figcaption
Linksa (href with http/https)
Inline stylestyle 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: and javascript: URIs in href or src attributes

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