Going Stellar

Home/Jira formatting reference

Jira text formatting

Line breaks and paragraphs in Jira wiki markup and ADF

A blank line starts a new paragraph. A single line break inside a paragraph is kept as a forced break, and so is a double backslash. In ADF the first is two paragraph nodes and the second is a hardBreak node inside one paragraph. Use a blank line for separate thoughts and a single break for addresses, signatures or short lists.

Wiki markup

first paragraph

second paragraph
line one
line two
line one\\line two

Stored as ADF (REST API v3)

The ADF document Jira Cloud stores for ADF:{"content": [{"content": [{"text": "one", "type": "text"}, {"type": "hardBreak"}, {"text": "two", "type": "text"}], "type": "paragraph"}], "type": "doc", "version": 1}:

{
 "type": "doc",
 "version": 1,
 "content": [
  {
   "type": "paragraph",
   "content": [
    {
     "type": "text",
     "text": "one"
    },
    {
     "type": "hardBreak"
    },
    {
     "type": "text",
     "text": "two"
    }
   ]
  }
 ]
}

Examples

Wiki markup (API v2)

first paragraph

second paragraph

A blank line gives two paragraph nodes and two p elements.

Rendered by Jira (HTML)

<p>first paragraph</p>

<p>second paragraph</p>

Back to wiki after the round trip

first paragraph

second paragraph

Sent to Jira Cloud on .

Wiki markup (API v2)

line one
line two

One newline is enough for a line break. Jira renders a br element and stores a hardBreak node.

Rendered by Jira (HTML)

<p>line one<br/>
line two</p>

Back to wiki after the round trip

line one
line two

Sent to Jira Cloud on .

Wiki markup (API v2)

line one\\line two

The double backslash forces a break without a newline in the source. It renders with a forced-newline class.

Rendered by Jira (HTML)

<p>line one<br class="atl-forced-newline" />line two</p>

Back to wiki after the round trip

line one
line two

Sent to Jira Cloud on .

Wiki markup (API v2)

a \\ b

Spaces around the backslashes stay in the text on both sides of the break.

Rendered by Jira (HTML)

<p>a <br class="atl-forced-newline" /> b</p>

Back to wiki after the round trip

a 
 b

Sent to Jira Cloud on .

ADF (API v3)

{"content": [{"content": [{"text": "one", "type": "text"}, {"type": "hardBreak"}, {"text": "two", "type": "text"}], "type": "paragraph"}], "type": "doc", "version": 1}

A hardBreak node between two text nodes, written directly as ADF. Wiki markup reads it back as a newline.

Rendered by Jira (HTML)

<p>one<br/>
two</p>

Back to wiki after the round trip

one
two

Sent to Jira Cloud on .

Wiki markup (API v2)

{color:red}
line one
line two
{color}

A multi-line colour block becomes one paragraph with the colour mark repeated on each line, so the wiki read-back repeats the colour tags.

Rendered by Jira (HTML)

<p><font color="red"><br/>
line one<br/>
line two</font></p>

Back to wiki after the round trip

{color:#ff0000}line one{color}
{color:#ff0000}line two{color}

Sent to Jira Cloud on .

What changes in conversion

  • A blank line and two paragraph nodes convert both ways without loss.
  • A single newline in wiki markup is stored as a hardBreak node, so it is not a separate paragraph.
  • The double backslash is also stored as a hardBreak. The wiki read-back writes a plain newline, so the \\ is lost on the first save through ADF.
  • The visible result is the same line break. The html differs only in the forced-newline class that Jira adds for the backslash form.

Pitfalls

  • Two newlines make a paragraph and one newline makes a break, so a single newline inside a paragraph is never ignored.
  • \\ directly followed by text still breaks the line, but the read-back drops the backslashes. Do not use it as a marker you search for later.
  • A {color} block that starts with a newline renders a leading br before the first line, as in the example above.

Sources

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

Markdown version · All formatting pages