Going Stellar

Home/Jira formatting reference

Jira text formatting

Superscript and subscript in Jira: ^ and ~ and ADF

Carets give superscript and tildes give subscript in Jira wiki markup. Jira Cloud stores both as one ADF mark called subsup, with a type attribute of sup or sub. Markdown has no syntax for them in the Atlassian documentation.

Wiki markup

^superscript^
~subscript~

Stored as ADF (REST API v3)

The ADF document Jira Cloud stores for ADF:{"content": [{"content": [{"marks": [{"attrs": {"type": "sup"}, "type": "subsup"}], "text": "sup", "type": "text"}, {"text": " ", "type": "text"}, {"marks": [{"attrs": {"type": "sub"}, "type": "subsup"}], "text": "sub", "type": "text"}], "type": "paragraph"}], "type": "doc", "version": 1}:

{
 "type": "doc",
 "version": 1,
 "content": [
  {
   "type": "paragraph",
   "content": [
    {
     "type": "text",
     "text": "sup",
     "marks": [
      {
       "type": "subsup",
       "attrs": {
        "type": "sup"
       }
      }
     ]
    },
    {
     "type": "text",
     "text": " "
    },
    {
     "type": "text",
     "text": "sub",
     "marks": [
      {
       "type": "subsup",
       "attrs": {
        "type": "sub"
       }
      }
     ]
    }
   ]
  }
 ]
}

Examples

Wiki markup (API v2)

^superscript^

The basic superscript form, rendered as a sup element.

Rendered by Jira (HTML)

<p><sup>superscript</sup></p>

Back to wiki after the round trip

^superscript^

Sent to Jira Cloud on .

Wiki markup (API v2)

~subscript~

The basic subscript form, rendered as a sub element.

Rendered by Jira (HTML)

<p><sub>subscript</sub></p>

Back to wiki after the round trip

~subscript~

Sent to Jira Cloud on .

Wiki markup (API v2)

x^2^ and H~2~O

Exponents and chemical formulas typed against the letters around them. Both stay as plain characters.

Rendered by Jira (HTML)

<p>x^2^ and H~2~O</p>

Back to wiki after the round trip

x^2^ and H~2~O

Sent to Jira Cloud on .

Wiki markup (API v2)

~~tilde strike~~

Double tildes read as a subscript with one literal tilde on each side, which is why Markdown strikethrough fails in wiki text.

Rendered by Jira (HTML)

<p>~<sub>tilde strike</sub>~</p>

Back to wiki after the round trip

~~tilde strike~~

Sent to Jira Cloud on .

ADF (API v3)

{"content": [{"content": [{"marks": [{"attrs": {"type": "sup"}, "type": "subsup"}], "text": "sup", "type": "text"}, {"text": " ", "type": "text"}, {"marks": [{"attrs": {"type": "sub"}, "type": "subsup"}], "text": "sub", "type": "text"}], "type": "paragraph"}], "type": "doc", "version": 1}

Sent as ADF through v3: both variants of the subsup mark in one line, and how v2 writes them back.

Rendered by Jira (HTML)

<p><sup>sup</sup> <sub>sub</sub></p>

Back to wiki after the round trip

^sup^ ~sub~

Sent to Jira Cloud on .

What changes in conversion

  • Superscript and subscript are one ADF mark with an attribute, so wiki ^ and ~ map to subsup with sup or sub and back, without loss.
  • The ADF mark can cover any text, but the wiki parser did not convert carets or tildes that touch letters on both sides. For a formula such as H2O with a subscript 2, send the ADF subsup mark through v3.
  • There is no Markdown shortcut for either effect in the Atlassian documentation.

Pitfalls

  • x^2^ and H~2~O did not convert. The notation was not converted when attached to letters. The ADF subsup mark has no such limit.
  • Double tildes are a subscript with literal tildes, not a strikethrough. Use hyphens for strike in wiki.
  • The tilde also starts a user mention in the form [~username], so keep that pattern in mind when mixing them in one line.

Sources

  1. Text Formatting Notation Help (Jira, in-product help)
  2. Atlassian Document Format: document structure (Jira Cloud platform)

Markdown version · All formatting pages