Documentation for Confluence 2.5.4 - 2.5.8.
Documentation for [Confluence Cloud] and the latest Confluence Server is available too.

The {html-include} macro allows you to include the contents of an HTML file in a Confluence page. The {html} macro allows you to include snippets of HTML within an existing page.

Why are they disabled?

Including unknown HTML inside a webpage is dangerous. Because HTML can contain active scripting components, it would be possible for a malicious attacker to present a user of your site with script that their web browser would believe came from you. Such code could be used, for example, to steal a user's authentication cookie and give the attacker their Confluence login password.

You should only turn on these macros if you trust all your users not to attempt to exploit them.

How do I enable them?

You will need:

  • Confluence 1.1 以降
    • Instructions for 1.0 are included below
  • Global "Administrate Confluence" permissions

手順説明

  1. Go to the Administrative Console and click on the Plugins section
  2. Select the "HTML Macros" library
  3. Click the "Enable Library" link
  4. If they are not now automatically enabled, enable the specific macros you wish to use

If you are using Confluence 1.0.3a or earlier

You should consider upgrading. It's a free upgrade and there are hundreds of things that we have added, fixed or improved since then.

(warning) The instructions below are historical documentation that applies only to Confluence 1.0.3a and earlier. If you are using Confluence 1.1. or later, use the instructions above.

Find the file wikiSubsystemContext.xml. It will be in the application's WEB-INF directory. You will find the following lines commented out.

<!--                <entry key="html-include"><ref local="htmlIncludeMacro"/></entry>-->
<!--                <entry key="html"><ref local="html"/></entry>-->

Remove the XML comments as shown below, and restart Confluence. The macros should now be available.

<entry key="html-include"><ref local="htmlIncludeMacro"/></entry>
<entry key="html"><ref local="html"/></entry>

Confluence 1.1 will allow the site administrator to enable and disable macros from within Confluence without editing any files.

用途

Example - To embed an external page

{html-include:url=http://www.example.com}