Home/Confluence storage format reference
Confluence storage format
Unknown and empty macros in Confluence storage format
Confluence accepts any ac:structured-macro name. A name it does not know is stored unchanged and rendered as a placeholder image. A known macro that lacks a required parameter renders an error message in place of its output. A macro with no body can disappear when the page goes through ADF.
Storage format
<ac:structured-macro ac:name="any-name"></ac:structured-macro>
<ac:structured-macro ac:name="info"></ac:structured-macro>
As ADF (Confluence Cloud)
The ADF that Confluence Cloud builds for:
<ac:structured-macro ac:name="unknown-macro-xyz"></ac:structured-macro>
{
"type": "doc",
"content": [
{
"type": "extension",
"attrs": {
"extensionType": "com.atlassian.confluence.macro.core",
"extensionKey": "unknown-macro-xyz",
"parameters": {
"macroParams": {
"_parentId": {
"value": "<page id>"
}
},
"macroMetadata": {
"macroId": {
"value": "<id>"
},
"schemaVersion": {
"value": "1"
},
"title": "unknown-macro-xyz"
}
}
}
}
],
"version": 1
}
Examples
Storage format sent
<ac:structured-macro ac:name="unknown-macro-xyz"></ac:structured-macro>A macro name that no app provides. It saves without error and shows the unknown-macro placeholder, which names the macro in its URL.
Rendered view (HTML)
<img class="wysiwyg-unknown-macro" src="https://your-site.atlassian.net/wiki/plugins/servlet/confluence/placeholder/unknown-macro?name=unknown-macro-xyz&locale=en_US&version=2" />Storage format after the round trip through ADF
<ac:structured-macro ac:name="unknown-macro-xyz" ac:schema-version="1" ac:macro-id="<id>" />Sent to Confluence Cloud on .
Storage format sent
<ac:structured-macro ac:name="info"></ac:structured-macro>An info macro with no body. The view is an empty info box, but the ADF holds only an empty paragraph.
Rendered view (HTML)
<div class="confluence-information-macro confluence-information-macro-information conf-macro output-block" data-hasbody="false" data-macro-id="<id>" data-macro-name="info"><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"> </span><div class="confluence-information-macro-body"> </div></div>Storage format after the round trip through ADF
<p />Sent to Confluence Cloud on .
Storage format sent
<ac:structured-macro ac:name="pageindex"></ac:structured-macro>The name pageindex is not the key Atlassian lists for the Page Index macro, which is index. The wrong name is treated as unknown.
Rendered view (HTML)
<img class="wysiwyg-unknown-macro" src="https://your-site.atlassian.net/wiki/plugins/servlet/confluence/placeholder/unknown-macro?name=pageindex&locale=en_US&version=2" />Storage format after the round trip through ADF
<ac:structured-macro ac:name="pageindex" ac:schema-version="1" ac:macro-id="<id>" />Sent to Confluence Cloud on .
Storage format sent
<ac:structured-macro ac:name="rolloverwithoudbody"></ac:structured-macro>The rollover macro key from the removed list. The macro is stored and returned, with the unknown-macro placeholder as its view.
Rendered view (HTML)
<img class="wysiwyg-unknown-macro" src="https://your-site.atlassian.net/wiki/plugins/servlet/confluence/placeholder/unknown-macro?name=rolloverwithoudbody&locale=en_US&version=2" />Storage format after the round trip through ADF
<ac:structured-macro ac:name="rolloverwithoudbody" ac:schema-version="1" ac:macro-id="<id>" />Sent to Confluence Cloud on .
Storage format sent
<ac:structured-macro ac:name="roadmap"></ac:structured-macro>The roadmap macro with no parameters. The view is an error message, and the ADF holds a migration extension that says 'Corrupted content'.
Rendered view (HTML)
<div class="error">Error rendering macro 'roadmap' : Cannot invoke "String.length()" because "<parameter1>" is null</div>Storage format after the round trip through ADF
<ac:structured-macro ac:name="roadmap" ac:schema-version="1" ac:macro-id="<id>" />Sent to Confluence Cloud on .
Storage format sent
<ac:structured-macro ac:name="content-by-user"></ac:structured-macro>The content-by-user macro with no parameters. The view is an error message that ends in null.
Rendered view (HTML)
<div class="error">Error rendering macro 'content-by-user' : null</div>Storage format after the round trip through ADF
<ac:structured-macro ac:name="content-by-user" ac:schema-version="1" ac:macro-id="<id>" />Sent to Confluence Cloud on .
Storage format sent
<ac:structured-macro ac:name="navmap"></ac:structured-macro>The navmap macro without a label. The view is an error that asks for a labelName.
Rendered view (HTML)
<div class="error">Error rendering macro 'navmap' : com.atlassian.renderer.v2.macro.MacroException: You must specify a labelName.</div>Storage format after the round trip through ADF
<ac:structured-macro ac:name="navmap" ac:schema-version="1" ac:macro-id="<id>" />Sent to Confluence Cloud on .
What changes in conversion
- Unknown names are not removed. The ADF holds an extension node with the name as its extensionKey, and storage returns the same macro element.
- The roadmap macro without parameters produced an ADF migration extension with the text 'Corrupted content - please contact Atlassian Support' and the reason 'Exception while parsing ADF: null'. The original XML is kept in its cxhtml parameter, and saving it back returned the original macro.
- An info macro without a body is not kept: the ADF is an empty paragraph, and storage comes back as <p />.
Pitfalls
- A placeholder image in the view does not prove a typo. The html macro and content-by-label showed the same placeholder in the probes, so check the macro key against the documentation before concluding.
- An error text in the view, such as 'Error rendering macro', means the macro exists but its parameters are wrong or missing. The page still saves.
- Saving does not validate macro names. A misspelled name is stored as a working macro and appears only in the view.
Questions and answers
Does Confluence reject an unknown macro name?
No. The probe with an invented name saved normally and the name came back unchanged.
Related
- Macros removed from the Cloud editor
- Reporting macros (content by label, recently updated, attachments...)
- html, iframe and widget macros
- info, note, tip and warning macros
- Storage format vs ADF