Home/Jira formatting reference
Jira text formatting
Escaping characters with a backslash in Jira wiki markup
A backslash in front of a special character shows it as text instead of formatting. the stored ADF holds the plain characters with the backslash removed. That is why the escape is fragile once a field has been saved through ADF.
Wiki markup
\*not bold\*
\_not italic\_
\[not a link\]
\{noformat\}
\(y\)
Stored as ADF (REST API v3)
The ADF document Jira Cloud stores for \*not bold\*:
{
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "*not bold*"
}
]
}
]
}
Examples
Wiki markup (API v2)
\*not bold\*Shows two asterisks around the words. In ADF the text node holds *not bold* with no marks.
Rendered by Jira (HTML)
<p>*not bold*</p>Back to wiki after the round trip
*not bold*Sent to Jira Cloud on .
Wiki markup (API v2)
\_not italic\_The same for underscores.
Rendered by Jira (HTML)
<p>_not italic_</p>Back to wiki after the round trip
_not italic_Sent to Jira Cloud on .
Wiki markup (API v2)
\[not a link\]Square brackets stay literal. Unescaped, they would try to resolve a link.
Rendered by Jira (HTML)
<p>[not a link]</p>Back to wiki after the round trip
[not a link]Sent to Jira Cloud on .
Wiki markup (API v2)
\{noformat\}Curly braces stay literal. Only the opening brace is written back with a backslash.
Rendered by Jira (HTML)
<p>{noformat}</p>Back to wiki after the round trip
\{noformat}Sent to Jira Cloud on .
Wiki markup (API v2)
\(y\)Stops the (y) emoticon from turning into an image.
Rendered by Jira (HTML)
<p>(y)</p>Back to wiki after the round trip
(y)Sent to Jira Cloud on .
Wiki markup (API v2)
\h1. no headingA backslash in front of h1. does not escape it. The backslash is shown and the line is still not a heading.
Rendered by Jira (HTML)
<p>\h1. no heading</p>Back to wiki after the round trip
\h1. no headingSent to Jira Cloud on .
What changes in conversion
- The backslash is removed when the text is stored. The ADF text node contains the bare characters, for example *not bold*.
- Read back through v2 the wiki is *not bold* without backslashes, and rendering that text gives bold again.
- The same happens for _not italic_ (italic again), (y) (the thumbs-up emoticon again) and [not a link] (rendered as an error span).
- For braces only the opening one is escaped on the way back: \{noformat}.
- A backslash before h1. is not an escape. It stays as a literal character in the text.
Pitfalls
- Escaping only protects the first save. After the new editor saves the field, the wiki you read back is no longer escaped.
\h1.is not an escape. The backslash stays visible in the output.\\(two backslashes) is a line break, not an escaped backslash.
Related
- Line breaks and paragraphs
- {{monospaced}}
- {noformat} macro
- (y), (/) and other emoticons
- [alias|url] external links