Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
maxlevel2
minlevel2
typeflat
separatorpipe

Warning
titleConfluence 4.x

You must disable the html-migration macro provided in the Atlassian bundled Confluence Html Macros plugin under System Plugins in order to avoid Unknown Macro errors when inserting wiki markup with the html macro. Or surround with the wiki macro or any other non-migrated (compatibility mode) macro. Unfortunately, Atlassian ships the html-migration macro as enabled even though their html macro is disabled. This causes any html macro to be migrated without a supporting macro . See CONF-25656.

Users upgrading to Confluence 4.x should use HTML 4.0.0 to avoid issues caused by the problem above. Prior to 4.0.0, the html macro works in compatibility mode - see Confluence 4.0 compatibility for Table and other plugins

 

Section
Column

HTML Macro

Features

  • Supports security restrictions as described in CMSP.
  • Supports capabilities for including data similar to other scripting macros.
  • Find and replace support for adjusting resulting output.

Other HTML macros

Parameters

Table plus
ParameterDefault

...

Macro Browser LabelDescription
outputhtmlFormat

Determines how the output is

...

treated.

  • html -

...

  • standard html
  • xhtml - data is treated as xhtml and rendered with the Confluence xhtml renderer prior to display
  • wiki -

...

  • data is surrounded by a

...

  • noformat

...

  • macro. This is a very special case need.
script

...

macro bodyLocation of HTML data

...

If a location of data is specified, the included data will follow the body data (if any).

  • #filename - Data is read from the file located in confluence home directory/script/filename. Subdirectories can be specified.

...

...

  • a space template.
  • ^attachment - Data is read from an attachment to the current page.
  • page^attachment - Data is read from an attachment to the page name provided.
  • space:page^attachment - Data is read from an attachment to the page name provided in the space indicated.

...

find Find regex patterns

Comma separated list of regex patterns to use to post-process the output HTML with find and replace logic.

  • Example: (href=)(/display)
replace Replacement strings

Comma separated list corresponding to find patterns via index position in list. Single quote entries containing a comma.

  • Example: $1$base_url$2
encodingsystem defaultFile encodingEncoding for an external file if different from the system default handling. Example: UTF-8.
jtidyfalseSelect to use JTidyJTidy will ensure the HTML is well formed which can prevent page display problems.
clean

...

trueRemove conflicting tagsAllows display in Confluence page without an iframe. Removes html, body and (optionally) the head tags including their corresponding ending tags so that it displays properly on a Confluence page.
When not selected, the HTML is surrounded with an iframe.
head

...

falseInclude head section HTMLOnly in affect if clean=true. The head tag is always removed. However, setting this to true will retain all the other tags from the head section and treat them as regular body content. This is useful for retaining style information in particular.
noPanelfalseOmit panel when output is wiki A way of setting the nopanel parameter of the noformat macro. Only matters when output=wiki.
width500Width of iframeOnly in affect for clean=false
height500Height of iframeOnly in affect for clean=false
user URL user User name for URL access via basic authentication.
password URL user password User password for URL access via basic authentication. 
timeout Timeout in millisecondsURL connections may timeout before getting data. Use this to increase time needed for slow connections. Be careful using 0 for an infinite wait.

Usage

Example - HTML from a file in the script folder in the Confluence home directory

...