Home/Confluence storage format reference
Confluence storage format
Space, blog post, content and shortcut links in storage
Besides pages, ac:link can point at a space with ri:space, a blog post with ri:blog-post, a content id with ri:content-entity or a shortcut with ri:shortcut. A space link resolves to the space name. A shortcut link is rewritten as a link to a not found page in ADF.
Storage format
<ac:link><ri:space ri:space-key="SD" /></ac:link>
<ac:link><ri:blog-post ri:space-key="FOO" ri:content-title="First Post" ri:posting-day="2012/01/30" /></ac:link>
<ac:link><ri:content-entity ri:content-id="123" /></ac:link>
<ac:link><ri:shortcut ri:key="jira" ri:parameter="ABC-123" /></ac:link>
As ADF (Confluence Cloud)
The ADF that Confluence Cloud builds for:
<p><ac:link><ri:space ri:space-key="SD" /></ac:link></p>
{
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"text": "Software Development",
"type": "text",
"marks": [
{
"type": "link",
"attrs": {
"__confluenceMetadata": {
"spaceKey": "SD",
"linkType": "space"
},
"href": "https://your-site.atlassian.net/wiki/spaces/SD"
}
}
]
}
]
}
],
"version": 1
}
Examples
Storage format sent
<p><ac:link><ri:space ri:space-key="SD" /></ac:link></p>A link to a space by its key, with no body.
Rendered view (HTML)
<p><a href="/wiki/spaces/SD">Software Development</a></p>Storage format after the round trip through ADF
<p><ac:link><ri:space ri:space-key="SD" /><ac:link-body>Software Development</ac:link-body></ac:link></p>Sent to Confluence Cloud on .
Storage format sent
<p><ac:link><ri:blog-post ri:space-key="FOO" ri:content-title="First Post" ri:posting-day="2012/01/30" /></ac:link></p>A link to a blog post by space key, title and posting day.
Rendered view (HTML)
<p><a class="unresolved" href="#">First Post</a></p>Storage format after the round trip through ADF
<p><ac:link><ri:blog-post ri:space-key="FOO" ri:content-title="First Post" ri:posting-day="2012/01/30" /><ac:link-body>First Post</ac:link-body></ac:link></p>Sent to Confluence Cloud on .
Storage format sent
<p><ac:link><ri:content-entity ri:content-id="123" /></ac:link></p>A link to content by numeric id, without knowing its type.
Rendered view (HTML)
<p><a class="unresolved" href="#">123</a></p>Storage format after the round trip through ADF
<p><ac:link><ri:content-entity ri:content-id="123" /><ac:link-body>unnamed link</ac:link-body></ac:link></p>Sent to Confluence Cloud on .
Storage format sent
<p><ac:link><ri:shortcut ri:key="jira" ri:parameter="ABC-123" /></ac:link></p>A link built from a shortcut key and a parameter.
Rendered view (HTML)
<p><a class="unresolved" href="#">ABC-123@jira</a></p>Storage format after the round trip through ADF
<p><a href="https://your-site.atlassian.net/wiki/404?key%3Djira%3Bsearch%3Fq%3DABC-123">unnamed link</a></p>Sent to Confluence Cloud on .
What changes in conversion
- The space link is the only one that resolves in this test: the view shows the space name, and the ADF save keeps an ac:link with a link-body of that name.
- The blog post link and the content id link are kept as ac:link with their ri element. Both gain a link-body, with the title for the blog post and the text unnamed link for the content id.
- A shortcut link does not survive. The ADF save turns it into a plain a href to a not found address of the site, with the text unnamed link.
Pitfalls
- A content id link is shown as the bare id, 123 in the probe, when the content cannot be found, which hides the broken target.
- The blog post link was written with the posting day as year, month and day separated by slashes. Other formats were not tested.
- The ADF save replaced the shortcut with an address of the site not found page, so the shortcut key and parameter are no longer in the stored link.
Related
- <ac:link> to a page
- User links and mentions
- <a href> external links
- Link bodies: plain text and rich
- Reporting macros (content by label, recently updated, attachments...)