---
title: "Html-bobswift macro"
canonical: "https://support.appfire.com/space/HTML/70617206/Html-bobswift%20macro"
format: markdown
---
> Macro (aura-html)

> ℹ️ <span style="color: #000000">To comply with Atlassian requirements, the </span><span style="color: #000000">*HTML*</span><span style="color: #000000"> macro name has changed from </span><span style="color: #000000">*HTML*</span><span style="color: #000000"> to </span><span style="color: #000000">*Html-bobswift *</span><span style="color: #000000">from version 5.7.0. Any existing occurrences of the </span><span style="color: #000000">*HTML*</span><span style="color: #000000"> macro name are not affected by this change; however, only the </span><span style="color: #000000">*Html-bobswift*</span><span style="color: #000000"> macro name is now available in the macro browser for any new macro additions to the pages.</span>

## Features

- <span style="color: #000000">Render HTML content from within the macro body, attachments, or remote locations using URLs.</span>
- <span style="color: #000000">Allows malformed HTML to be cleaned so content displays properly with </span><span style="color: #000000">[JTidy](http://jtidy.sourceforge.net/)</span><span style="color: #000000">.</span>
- <span style="color: #000000">Supports find and replace for adjusting resulting output.</span>
- <span style="color: #000000">Allows the user to restrict the usage of Javascript in the </span><span style="color: #000000">*Html-bobswift*</span><span style="color: #000000"> macro (based on the configuration of </span><span style="color: #000000">*Allow Javascript*</span><span style="color: #000000"> in the</span><span style="color: #172b4d"> </span><span style="color: #172b4d">[Configuration](https://appfire.atlassian.net/wiki/x/l4E1B#Configuration-html_57_config_global)</span><span style="color: #172b4d"> </span><span style="color: #000000">page). The Confluence page throws a rendering error if this parameter is not enabled, and Javascript is inserted while using the macro.</span>
- <span style="color: #000000">Supports capabilities for including data similar to other scripting macros.</span>
- <span style="color: #000000">Supports security restrictions as described in</span> [Macro Security for Confluence](https://appfire.atlassian.net/wiki/x/CIAEB).

> ℹ️ - <span style="color: #000000">The macro works with valid, downloadable HTML files only. </span>
> ℹ️ - <span style="color: #000000">If you want to specify a URL in the </span><span style="color: #000000">*Location of HTML data*</span><span style="color: #000000"> parameter, make sure that only a raw URL is provided. A raw URL is defined as the part of the URL following the domain information and includes the query string, if present. For example, in the URL string </span>`http://www.contoso.com/articles/recent.aspx`<span style="color: #000000">, the raw URL is </span>`/articles/recent.aspx`<span style="color: #000000">.</span>

> ⚠️ *Important information for Macro Security users!*
> ⚠️ 
> ⚠️ <span style="color: #000000">Existing pages that use the </span><span style="color: #000000">*HTML*</span><span style="color: #000000"> macro name with the </span><span style="color: #000000">*Macro Security*</span><span style="color: #000000"> macro are unaffected, and for any new macro additions with the </span><span style="color: #000000">*Html-bobswift*</span><span style="color: #000000"> macro name, specify the same HTML configurations as given for the </span><span style="color: #000000">*HTML*</span><span style="color: #000000"> macro. In such cases, parameters for both, </span><span style="color: #000000">*HTML*</span><span style="color: #000000"> and </span><span style="color: #000000">*Html-bobswift*</span><span style="color: #000000">, macro names must be added in Macro Security for Confluence Configuration to render the HTML content on the pages correctly. Any entries made for the </span><span style="color: #000000">*XSLT*</span><span style="color: #000000"> macro remain unaffected and hence, the entries made for this macro can be retained as-is in the Macro Security configuration. Refer to the </span><span style="color: #000000">[Configuration page](https://appfire.atlassian.net/wiki/x/l4E1B#html_57_config_macroSecurity)</span><span style="color: #000000"> for more information.</span>

## <span style="color: #000000">Other HTML macros</span>

- <span style="color: #000000">Confluence comes with two native macros: </span><span style="color: #000000">*[{html}](https://confluence.atlassian.com/doc/html-macro-38273085.html)*</span><span style="color: #000000"> and </span><span style="color: #000000">*[{html-include}](https://confluence.atlassian.com/doc/html-include-macro-169120653.html)*</span><span style="color: #000000">. These macros are disabled by default in Confluence, since it is a security exposure unless you only have trusted users on your site. The native Confluence </span><span style="color: #000000">*HTML*</span><span style="color: #000000"> macros must be </span><span style="color: #000000">*disabled*</span><span style="color: #000000"> to use the </span><span style="color: #000000">*Html-bobswift*</span><span style="color: #000000"> macro of </span><span style="color: #000000">*HTML for Confluence*</span><span style="color: #000000">.</span>
- <span style="color: #000000">*HTML Tag*</span><span style="color: #000000"> - a safer alternative to the standard </span><span style="color: #000000">*{html}*</span><span style="color: #000000"> macro but does not allow for arbitrary HTML to be included.</span>

> ✅ <span style="color: #000000">By default, header content is excluded as it could interfere with a Confluence page's HTML code. Enable </span><span style="color: #000000">*Include head section HTML*</span><span style="color: #000000"> to include the header tag, provided it does not mess up the HTML content.</span>

## <span style="color: #000000">Parameters</span>

| **Macro browser label** | **Default** | **Description** | **Macro parameter** |
| --- | --- | --- | --- |
| <span style="color: #000000">*Format*</span> | <span style="color: #000000">*html*</span> | <span style="color: #000000">Specify how the output is treated. The options are as follows:</span><br>- <span style="color: #000000">*html*</span><span style="color: #000000"> - transformed output is standard HTML.</span>
- <span style="color: #000000">*xhtml*</span><span style="color: #000000"> - transformed output is treated as XHTML and rendered with the Confluence XHTML renderer.</span>
- <span style="color: #000000">*wiki*</span><span style="color: #000000"> - transformed output is treated as wiki markup and rendered with the Confluence wiki renderer.</span> | <span style="color: #000000">output</span> |
| <span style="color: #000000">*Profile*</span> |  | <span style="color: #000000">Enter the profile name to access the files to be rendered. Profiles contain a basic set of parameters used to access a remote location such as the type of URL, user credentials, and so on. Refer to </span><span style="color: #000000">[profiles configuration](https://appfire.atlassian.net/wiki/x/l4E1B#html_57_config_profiles)</span><span style="color: #000000"> to know more about profiles and see </span><span style="color: #000000">[tutorials](https://appfire.atlassian.net/wiki/x/2IE1B)</span><span style="color: #000000">. </span><br>> ⚠️ - <span style="color: #000000">Contact your Confluence administrator for further information about the profiles available in your instance.</span>
> ⚠️ - <span style="color: #000000">If a profile is specified, it is recommended to provide the relative path to the location of the HTML file to be rendered.</span> | <span style="color: #000000">profile</span> |
| <span style="color: #000000">*Location of HTML data*</span> | <span style="color: #000000">macro body</span> | <span style="color: #000000">Enter the location that contains the HTML file to be rendered. If a location of data is specified, the included data follows the body data (if any).</span><br>- <span style="color: #000000">*#filename*</span><span style="color: #000000"> - Data is read from the file located in Confluence </span>`home/script/filename`<span style="color: #000000"> directory. Subdirectories can be specified.</span>
- <span style="color: #000000">*global page template name*</span><span style="color: #000000"> - Data is read from a global page template. Special note:</span> [How to deal with templates on Confluence 4.3 and later](https://appfire.atlassian.net/wiki/spaces/info/pages/86120194)<span style="color: #000000">.</span>
- <span style="color: #000000">*space:page template name*</span><span style="color: #000000"> - Data is read from a space template.</span>
- <span style="color: #000000">*#http://...*</span><span style="color: #000000"> - Data is read from the URL specified. May require user name and password as well. </span><br>> ℹ️ <span style="color: #000000">If a </span><span style="color: #000000">*Profile*</span><span style="color: #000000"> is specified, the pound sign (#) is optional, that is, the URL is processed regardless of the pound sign (#) before the URL.</span><br>- *^attachment*<span style="color: #000000"> - Data is read from an attachment to the current page.</span>
- <span style="color: #000000">*page^attachment*</span><span style="color: #000000"> - Data is read from an attachment to the page name provided.</span>
- <span style="color: #000000">*space:page^attachment*</span><span style="color: #000000"> - Data is read from an attachment to the page name provided in the space indicated.</span><br>> ⚠️ *Precedence in URL handling*
> ⚠️ 
> ⚠️ <span style="color: #000000">URLs are processed using a fixed precedence explained as follows:</span>
> ⚠️ 
> ⚠️ 1. <span style="color: #000000">If the given URL is linked to a specific application like Bitbucket, GitLab, or GitLab, the macro does not require any user credentials, and processes and renders the given file. Refer to</span> [application links](https://appfire.atlassian.net/wiki/x/14Q1B) <span style="color: #000000">for information.</span>
> ⚠️ 2. <span style="color: #000000">If </span><span style="color: #000000">*Profile*</span><span style="color: #000000"> is specified, the macro appends the URL given here with the URL specified in the profile configuration, and accesses the location to render the required file.</span>
> ⚠️ 3. <span style="color: #000000">Lastly, if no application links or profiles were given, the URLs are processed as-is and the required file is rendered.</span> | <span style="color: #000000">script</span> |
| <span style="color: #000000">*Find regex patterns*</span> |  | <span style="color: #000000">Enter a comma-separated list of regex patterns to dynamically update the output content. Read </span>more about [regular expressions](https://appfire.atlassian.net/wiki/x/JIE1B)<span style="color: #000000">.</span><br><span style="color: #000000">Example: </span>`(href=)(/display)` | <span style="color: #000000">find</span> |
| <span style="color: #000000">*Replacement strings*</span> |  | <span style="color: #000000">Enter a comma-separated list of positions to search for patterns in the output content. Note that the positions are indexed beginning at "1". If a comma is a part of the search, use single quotes (') around it.</span><br><span style="color: #000000">Example: </span>`http://www.google.com/$1` | <span style="color: #000000">replace</span> |
| <span style="color: #000000">*File encoding*</span> | <span style="color: #000000">system default</span> | <span style="color: #000000">Specify the encoding for an external file, if different from the system default handling. </span><br><span style="color: #000000">Example: </span>`UTF-8` | <span style="color: #000000">encoding</span> |
| <span style="color: #000000">*Select to use JTidy*</span> | <span style="color: #000000">false</span> | <span style="color: #000000">Enable this option to use </span><span style="color: #000000">[JTidy](http://jtidy.sourceforge.net/)</span><span style="color: #000000"> to ensure the HTML is well formed to prevent page display problems.</span> | <span style="color: #000000">tidy</span> |
| <span style="color: #000000">*Remove conflicting tags*</span> | <span style="color: #000000">true</span> | <span style="color: #000000">Disable this option to surround the HTML with an iframe. By default, this parameter allows the display of HTML content in a Confluence page without an iframe. The </span><span style="color: #000000">*html*</span><span style="color: #000000">, </span><span style="color: #000000">*body*</span><span style="color: #000000">, and (optionally) the </span><span style="color: #000000">*head*</span><span style="color: #000000"> tags including their corresponding ending tags are removed so that it displays properly on a Confluence page.</span> | <span style="color: #000000">clean</span> |
| <span style="color: #000000">*Include head section HTML*</span> | <span style="color: #000000">false</span> | <span style="color: #000000">Enable this option to retain all the other tags from the header section and treat them as regular body content. This is useful for retaining style information in particular. By default, the head tag is always removed. Valid only if </span><span style="color: #000000">*Remove conflicting tags*</span><span style="color: #000000"> is enabled.</span> | <span style="color: #000000">head</span> |
| <span style="color: #000000">*Omit panel when output is wiki *</span> | <span style="color: #000000">false</span> | <span style="color: #000000">Enable this option to hide the panel around the rendered content. This parameter provides a way of setting the </span><span style="color: #000000">*nopanel*</span><span style="color: #000000"> parameter of the </span><span style="color: #000000">*noformat*</span><span style="color: #000000"> macro. Valid only if </span><span style="color: #000000">*Format*</span><span style="color: #000000"> is set to </span><span style="color: #000000">*wiki.*</span> | <span style="color: #000000">noPanel</span> |
| <span style="color: #000000">*Width of iframe*</span> | <span style="color: #000000">500</span> | <span style="color: #000000">Enter the width for the iframe that displays the HTML content. Valid only if </span><span style="color: #000000">*Remove conflicting tags*</span><span style="color: #000000"> is disabled.</span> | <span style="color: #000000">width</span> |
| <span style="color: #000000">*Height of iframe*</span> | <span style="color: #000000">500</span> | <span style="color: #000000">Enter the height for the iframe that displays the HTML content. Valid only if </span><span style="color: #000000">*Remove conflicting tags*</span><span style="color: #000000"> is disabled.</span> | <span style="color: #000000">height</span> |
| <span style="color: #000000">*Timeout in milliseconds*</span> |  | <span style="color: #000000">Enter time in milliseconds to wait until the URL connection times out before getting data. Use this to increase time needed for slow connections. Note that if a zero is given, the connection may wait indefinitely.</span> | <span style="color: #000000">timeout</span> |

> ℹ️ *About profiles:*
> ℹ️ 
> ℹ️ - <span style="color: #000000">Administrators create profiles to connect to remote locations. A profile contains the basic information required to access a remote location and usually contains the base URLs of the location. In the macro editor, you must specify the relative URL in the </span><span style="color: #000000">*Location of HTML data*</span><span style="color: #000000"> parameter. The macro combines these paths to create an absolute URL. If any part of this URL is incorrect or the URL itself is invalid, the macro generates an error. To get more information about profiles, select the relevant article specified in the </span><span style="color: #000000">[Helpful resources](#html_57_html_helpfulResources)</span><span style="color: #000000"> section.</span>
> ℹ️ - <span style="color: #000000">Since release 5.7.0, the </span><span style="color: #000000">*HTML*</span><span style="color: #000000"> macro name has changed from </span><span style="color: #000000">*HTML*</span><span style="color: #000000"> to </span><span style="color: #000000">*Html-bobswift*</span><span style="color: #000000">. Existing pages that use the </span><span style="color: #000000">*HTML*</span><span style="color: #000000"> macro name with the </span><span style="color: #000000">*Macro Security*</span><span style="color: #000000"> macro are unaffected. Any new pages that are created automatically use the </span><span style="color: #000000">*Html-bobswift*</span><span style="color: #000000"> macro name. So, entries for both, </span><span style="color: #000000">*HTML*</span><span style="color: #000000"> and </span><span style="color: #000000">*Html-bobswift*</span><span style="color: #000000">, macro names must be kept in Macro Security for Confluence Configuration. </span>  
> ℹ️ <span style="color: #000000">If any of these entries are not available in Macro Security for Confluence Configuration, an error, "Security restricted macro with parameter 'profile' is not allowed. An edit restriction is required that matches the macro authorization list.", is displayed. Ensure that the following entries are available for the </span><span style="color: #000000">*HTML*</span><span style="color: #000000"> macro name:</span>
> ℹ️   - <span style="color: #000000">Key: </span>*html.profile.**  
> ℹ️ <span style="color: #000000">Value: </span><span style="color: #000000">**ANY*</span>
> ℹ️   - <span style="color: #000000">Key: </span><span style="color: #000000">*html*</span>  
> ℹ️ <span style="color: #000000">Value: </span><span style="color: #000000">**ANY*</span>
> ℹ️   - <span style="color: #000000">Key: </span><span style="color: #000000">*html.allowJavascript*</span>  
> ℹ️ <span style="color: #000000">Value: </span><span style="color: #000000">**ANY*</span>
> ℹ️   <span style="color: #000000">Ask your administrator to manually add the following entries for the </span><span style="color: #000000">*Html-bobswift*</span><span style="color: #000000"> macro name in </span><span style="color: #000000">**Macro Security for Confluence Configuration**</span><span style="color: #000000"> > </span><span style="color: #000000">**Secured macros**</span><span style="color: #000000">:</span>
> ℹ️   - <span style="color: #000000">Key: </span>*html-bobswift.profile.**  
> ℹ️ <span style="color: #000000">Value: </span><span style="color: #000000">**ANY*</span>
> ℹ️   - <span style="color: #000000">Key: </span><span style="color: #000000">*html-bobswift*</span>  
> ℹ️ <span style="color: #000000">Value: </span><span style="color: #000000">**ANY*</span>
> ℹ️   - <span style="color: #000000">Key: </span><span style="color: #000000">*html-bobswift.allowJavascript*</span>  
> ℹ️ <span style="color: #000000">Value: </span><span style="color: #000000">**ANY*</span>

## <span style="color: #000000">Usage examples</span>

### <span style="color: #000000">HTML from a file in the Confluence </span><span style="color: #000000">*home/script*</span><span style="color: #000000"> directory</span>

```
{html:script=#example.html}
{html}

```

### <span style="color: #000000">HTML from an attachment</span>

```
{html:script=^example.html}
{html}

```

### <span style="color: #000000">HTML put within </span><span style="color: #000000">*{noformat}*</span><span style="color: #000000"> panel</span>

```
{html:output=wiki|noPanel=true}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aliquam fermentum vestibulum est. Cras rhoncus.
{html}

```

### <span style="color: #000000">HTML from a URL</span>

```
{html:script=#http://localhost/example.html}
{html}

```

### <span style="color: #000000">Use of CSS </span><span style="color: #000000">*inline*</span><span style="color: #000000"> style sheet</span>

```
{html}
<P style="font-size: x-large; color: #8000">
   Using inline style sheets - or is that inline styles?
</p>
{html}

```

### <span style="color: #000000">Use of CSS </span><span style="color: #000000">*external*</span><span style="color: #000000"> style sheet</span>

```
{html}
<LINK href="http://www.cssgarden.com/css/T22/keylime_0001.css"  rel="stylesheet" title="default" type="text/css"></LINK>
<H1>Absolute </H1>
{html}

```

<span style="color: #000000">Make sure that style sheet is available on a server and provide the absolute URL reference to this external style sheet resource.</span>

## > Macro (anchor)

<span style="color: #000000">Helpful resources</span>

- <span style="color: #000000">[How to use URLs in the HTML for Confluence macros](https://appfire.atlassian.net/wiki/x/5IQ1B)</span>
- <span style="color: #000000">[Key concepts](https://appfire.atlassian.net/wiki/x/voU1B)</span><span style="color: #000000"> to understand how to link and render HTML content from other sources</span>