Home/Jira formatting reference
Jira text formatting
Monospace in Jira: {{monospaced}} in wiki markup and ADF
Double curly braces around text give inline monospace in Jira wiki markup. Jira Cloud stores it as the ADF code mark, which can combine only with a link. Markdown single backticks work in the new editor as you type, per the Atlassian documentation, but not as wiki input.
Wiki markup
{{monospaced}}
Markdown shortcuts in the editor
Per the Atlassian documentation, not tested.
| Type | What happens |
|---|---|
`text` | Converts to monospace as you type, per the Atlassian documentation. |
Stored as ADF (REST API v3)
The ADF document Jira Cloud stores for {{monospaced}}:
{
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "monospaced",
"marks": [
{
"type": "code"
}
]
}
]
}
]
}
Examples
Wiki markup (API v2)
{{monospaced}}The basic form, rendered as a tt element.
Rendered by Jira (HTML)
<p><tt>monospaced</tt></p>Back to wiki after the round trip
{{monospaced}}Sent to Jira Cloud on .
Wiki markup (API v2)
{{mono *with bold*}}Bold inside monospace. The v2 render shows bold, but the stored ADF has only the code mark and literal stars.
Rendered by Jira (HTML)
<p><tt>mono <b>with bold</b></tt></p>Back to wiki after the round trip
{{mono *with bold*}}Sent to Jira Cloud on .
Wiki markup (API v2)
`backtick`The Markdown backtick form sent as wiki input. Nothing converts.
Rendered by Jira (HTML)
<p>`backtick`</p>Back to wiki after the round trip
`backtick`Sent to Jira Cloud on .
ADF (API v3)
{"content": [{"content": [{"marks": [{"type": "code"}, {"attrs": {"href": "https://example.com"}, "type": "link"}], "text": "code link", "type": "text"}], "type": "paragraph"}], "type": "doc", "version": 1}Sent as ADF through v3: the code mark together with a link, the one mark pair the documentation allows.
Rendered by Jira (HTML)
<p><tt><a href="https://example.com" class="external-link" rel="nofollow noreferrer">code link</a></tt></p>Back to wiki after the round trip
{{[code link|https://example.com]}}Sent to Jira Cloud on .
Wiki markup (API v2)
{code}
*not bold* inside code
{code}The block macro for comparison: content is literal and Jira adds the language java when it stores a codeBlock.
Rendered by Jira (HTML)
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">*not bold* inside code
</pre>
</div></div>Back to wiki after the round trip
{code:java}*not bold* inside code{code}Sent to Jira Cloud on .
What changes in conversion
- Inline monospace round-trips as the ADF code mark. Wiki
{{text}}and ADF code are equivalent in both directions. - The ADF documentation says code can combine only with link. A v3 request with code and strong on the same text was rejected with INVALID_INPUT, while code with link was accepted.
- Because of that rule,
{{mono *with bold*}}is stored as one code run with the stars as ordinary characters. The bold shown by the v2 render is lost in ADF. - A link inside monospace comes back through v2 as
{{[code link|https://example.com]}}.
Pitfalls
- Backticks are a Markdown editor shortcut only. In a wiki field or a v2 comment, use double curly braces.
- Do not rely on bold, colour or highlight inside monospace. The ADF rules reject or drop those combinations.
- Use the code macro, not double braces, for several lines. Its content is literal and it is stored as a code block.
Related
- {code} macro
- {noformat} macro
- *strong* (bold)
- Escaping with backslash
- Combining and nesting text effects