# Inline comment markers in Confluence storage format

URL: https://goingstellar.ro/reference/confluence-storage-format/inline-comments/

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

```xml
<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:

```xml
<p><ac:inline-comment-marker ac:ref="abc">commented text</ac:inline-comment-marker></p>
```

```json
{
 "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:

```xml
<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):

```html
<p><span class="inline-comment-marker" data-ref="abc">commented text</span></p>
```

Storage format after the round trip through ADF:

```xml
<p><ac:inline-comment-marker ac:ref="abc">commented text</ac:inline-comment-marker></p>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
<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):

```html
<p><span style="background-color: rgb(254,222,200);">highlight</span></p>
```

Storage format after the round trip through ADF:

```xml
<p><span style="background-color: rgb(254,222,200);">highlight</span></p>
```

Sent to Confluence Cloud on 29 Nov 2026.

Storage format sent:

```xml
<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):

```html
<p></p>
```

Storage format after the round trip through ADF:

```xml
<p><ac:placeholder>Type the summary here</ac:placeholder></p>
```

Sent to Confluence Cloud on 29 Nov 2026.

## 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](https://goingstellar.ro/reference/confluence-storage-format/rest-api-representations/)
- [Storage format vs ADF](https://goingstellar.ro/reference/confluence-storage-format/storage-vs-adf/)
- [Macros removed from the Cloud editor](https://goingstellar.ro/reference/confluence-storage-format/legacy-macros/)
- [Text highlight](https://goingstellar.ro/reference/confluence-storage-format/background-highlight/)

## Sources

- [Atlassian Document Format: document structure (Atlassian Developer)](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/)
- [Confluence Cloud REST API v1: content (Atlassian Developer)](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content/)
- [The legacy content macro (Atlassian Support)](https://support.atlassian.com/confluence-cloud/docs/the-legacy-content-macro/)

