Links

When editing pages using Alt Text Editor, adding markdown links, for simple use cases, work exactly like they do in the CommonMark spec examples. That is, they look like this:

For more info, click [here](http://yoursite.com/info)

Confluence, however, supports many different kinds of links - which is the hallmark of a great wiki! Examples include links pointing to users, other pages (by way of the page title and space key), as well as attachments.

To support Confluence's wide variety of links, Alt Text Editor provides both an extension to the CommonMark spec for links, as well as a custom link directive for very complex use cases.

For 95% of use cases, the standard markdown syntax is used, but with a Confluence-specific URI scheme for specifying the target of the link.

Examples

A standard markdown link, using a standard URL

For more info, click [here](https://support.atlassian.com/)
For more info, click <a href="https://support.atlassian.com/">here</a>

A link to a page named 'guide', where 'guide' is in the same space as the page containing the link. It uses a Confluence-specific URI for pages

For more info, click [here](page://guide)
<p>For more info, click <ac:link>
    <ri:page ri:content-title="guide" />
    <ac:link-body>here</ac:link-body>
  </ac:link></p>

A link to a page named 'better guide', where 'better guide' is in the same space as the page containing the link. Note the space in the page title, and angle brackets that are necessary

For more info, click [here](<page://better guide>)
<p>For more info, click <ac:link>
    <ri:page ri:content-title="better guide" />
    <ac:link-body>here</ac:link-body>
  </ac:link></p>

A link to version 5 of a page with the title 'guide' where the page located in the current space

For more info, click [here](page://guide?v=5)
<p>For more info, click <ac:link>
    <ri:page ri:content-title="guide" ri:version-at-save="5" />
    <ac:link-body>here</ac:link-body>
  </ac:link></p>

A link to version 5 of a page with the title 'guide' located in a different space

For more info, click [here](page://guide?space=demos&v=5)
<p>For more info, click <ac:link>
   <ri:page ri:content-title="guide" ri:space-key="demos" ri:version-at-save="5" />
   <ac:link-body>here</ac:link-body>
 </ac:link>
</p>

A link pointing to a space by using its space key

For more info, click [here](space://demos)
<p>For more info, click <ac:link>
    <ri:space ri:space-key="demos" />
    <ac:link-body>here</ac:link-body>
  </ac:link>
</p>

A link to an anchor on the link's host page

For more info, click [here](#appendix)
<p>For more info, click <ac:link ac:anchor="appendix">
    <ac:link-body>here</ac:link-body>
  </ac:link>
</p>

A link to a user or account. Depending on how your site is hosted (Confluence Cloud vs. Confluence Data Center), your page's Storage Format might be linking to users by either account id or user key. See below

Common for Confluence Data Center:

For more info, contact [](user@hugemassive)
<p>For more info, contact <ac:link>
    <ri:user ri:userkey="hugemassive" />
  </ac:link>
</p>

Common for Confluence Cloud:

For more info, contact [](account@123456789)
<p>For more info, contact <ac:link>
    <ri:user ri:account-id="123456789" />
  </ac:link>
</p>

A link to a specific version of an attachment

For more info, download [](file://spreadsheet.xlsx?v=2)
<p>For more info, download <ac:link>
    <ri:attachment ri:filename="spreadsheet.xlsx" ri:version-at-save="2" />
  </ac:link>
</p>

A link with a plain text body, intended to display that content verbatim, without processing it

For more info, click [`this link here`](page://guide)
<p>For more info, click <ac:link>
    <ri:page ri:content-title="guide" />
    <ac:plain-text-link-body>
      <![CDATA[this link here]]>
    </ac:plain-text-link-body>
  </ac:link>
</p>

A link with markdown body, where that body content should be processed

For more info, click [*here*](page://guide)
<p>For more info, click <ac:link>
    <ri:page ri:content-title="guide" />
    <ac:link-body><em>here</em></ac:link-body>
  </ac:link>
</p>

A link with a multi-line, block body.

This example demonstrates the uncommon case where the standard link syntax cannot be used do to the nature of the Storage Format and the inline flow of the markdown content surrounding the link. A directive is needed for the content, and to keep the markdown valid, it is additionally converted into a def.

Alt Text Editor will handle use cases like this for you automatically.

A :link{#1} here.

:::linkdef{defId=1}
<ac:link>
    <ri:page ri:content-title="guide" />
    <ac:link-body>Link Body
      <br />
      <br />
    </ac:link-body>
  </ac:link>
:::
<p>A <ac:link>
    <ri:page ri:content-title="guide" />
    <ac:link-body>Link Body
      <br />
      <br />
    </ac:link-body>
  </ac:link> here.</p>