Home/Confluence storage format reference
Confluence storage format
Inline comment markers in Confluence storage format
An inline comment is stored as an ac:inline-comment-marker element around the commented text, with an ac:ref that identifies the comment. In ADF it is an annotation mark of type inlineComment on the text. The marker round trips unchanged.
Storage format
<p><ac:inline-comment-marker ac:ref="abc">commented text</ac:inline-comment-marker></p>
As ADF (Confluence Cloud)
The ADF that Confluence Cloud builds for:
<p><ac:inline-comment-marker ac:ref="abc">commented text</ac:inline-comment-marker></p>
{
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"text": "commented text",
"type": "text",
"marks": [
{
"type": "annotation",
"attrs": {
"annotationType": "inlineComment",
"id": "abc"
}
}
]
}
]
}
],
"version": 1
}
Examples
Storage format sent
<p><ac:inline-comment-marker ac:ref="abc">commented text</ac:inline-comment-marker></p>Text with a comment marker, as it is stored when a reader highlights a phrase and comments on it.
Rendered view (HTML)
<p><span class="inline-comment-marker" data-ref="abc">commented text</span></p>Storage format after the round trip through ADF
<p><ac:inline-comment-marker ac:ref="abc">commented text</ac:inline-comment-marker></p>Sent to Confluence Cloud on .
Storage format sent
<p><span style="background-color: rgb(254,222,200);">highlight</span></p>Contrast: highlighted text is a span with a style, not a comment marker, so it has no thread and no data-ref.
Rendered view (HTML)
<p><span style="background-color: rgb(254,222,200);">highlight</span></p>Storage format after the round trip through ADF
<p><span style="background-color: rgb(254,222,200);">highlight</span></p>Sent to Confluence Cloud on .
Storage format sent
<p><ac:placeholder>Type the summary here</ac:placeholder></p>Contrast: another element that exists only for the editor. A placeholder is kept in storage and ADF but does not appear in the rendered text.
Rendered view (HTML)
<p></p>Storage format after the round trip through ADF
<p><ac:placeholder>Type the summary here</ac:placeholder></p>Sent to Confluence Cloud on .
What changes in conversion
- The marker and its ac:ref survive the storage to ADF to storage round trip exactly, and the commented text stays inside the element.
- In ADF the text node carries a mark of type annotation with annotationType inlineComment and the same id as the ac:ref value.
- The rendered page replaces the element with a span of class inline-comment-marker and a data-ref attribute holding the ref.
Pitfalls
- The ref ties the text to a comment thread. The probe used a ref with no matching thread, so what the editor shows for it was not tested.
- The ref in ADF is the same string as the ac:ref in storage, so a script that rewrites one side must copy the other unchanged.
- Content inside the legacy content macro cannot take inline comments, according to the documentation for that macro.
Related
- REST API body representations
- Storage format vs ADF
- Macros removed from the Cloud editor
- Text highlight