Markdown Syntax
In different locations around Hub, you have the ability to format blocks of text. This formatting is applied using the Markdown markup syntax. Markdown is supported for the following features in Hub:
Feature | Description |
---|---|
These widgets use Markdown to format text. These widgets can be placed on dashboards and project overview pages. | |
The project description that is shown on a project overview page is formatted in Markdown. | |
The agreement text that is presented to users who are required to accept an information notice to access Hub is formatted in Markdown. |
The Markdown implementation in YouTrack follows the CommonMark specification with extensions. These extensions support formatting options that are not included in the formal specification like strikethrough text, tables, and autolinks.
To see any of these formatting options in action, paste the sample block of code into an input field that accepts Markdown.
Character Formatting
You can format inline text with the following Markdown syntax.
Style | Syntax |
---|---|
Strong | Surround text with two asterisks ( |
Emphasis | Surround text with single asterisks ( |
Strikethrough | Surround text with two tildes ( |
Code | Surround text with single backquotes ( |
Combinations | Surround text with single underscore characters or two tildes inside two asterisks. Surround text with three asterisks to apply strong emphasis. |
Headings
To apply a heading style, start the line with one to six number signs #
. Follow the number signs with a space character and enter the heading text. The number of #
signs determines the heading level.
Hub also supports an alternative syntax for heading levels 1 and 2:
For heading level 1, enter one or more
=
characters on the following line.For heading level 2, enter one or more
-
characters on the following line.
Paragraphs and Line Breaks
Contiguous lines of text belong to the same paragraph. Use the following guidelines to structure your content into paragraphs and enter line breaks.
To start a new paragraph, leave a blank line between lines of text.
To start a new line inside a paragraph, enter two trailing spaces at the end of the line of text.
Thematic Breaks
Create sections in your content with horizontal lines. Use any of the following methods to add a horizontal line:
Three underscores (
___
)Three minus signs (
---
)Three asterisks (
***
)
Block Quotes
Use block quotes to call special attention to a quote from another source. You can apply character formatting to inline text inside the quoted block.
To set text as a quote block, start the line with one or more >
characters. Follow these characters with a space and enter the quoted text. The number of >
signs determines the level of nesting inside the quote block.
If your quote spans multiple paragraphs, each blank line must start with the >
character. This ensures that the entire quote block is grouped together.
Indented Code Blocks
You can format blocks of text in a monospaced font to make it easier to identify and read as code.
To format a code block in Markdown, indent every line of the block by at least four spaces. An indented code block cannot interrupt a paragraph, so you must insert at least one blank line between a paragraph the indented code block that follows. The input is processed is as follows:
One level of indentation (four spaces) is removed from each line of the code block.
The contents of the code block are literal text and are not parsed as Markdown.
Any non-blank line with fewer than four leading spaces ends the code block and starts a new paragraph.
Fenced Code Blocks
Unlike indented code blocks, fenced code blocks have an info string that lets you specify which language is used for syntax highlighting. Language-specific highlights make the code easier to read.
Syntax highlighting is supported for a range of languages. YouTrack detects and highlights code in C, C++, C#, Java, JavaScript, Perl, Python, Ruby, and SH automatically. To highlight code in other languages, set the language in the info string (the line with the opening code fence). The following languages are supported: apollo (AGC/AEA Assembly Language), basic, clj (Clojure) css, dart, erlang, hs (Haskell), kt (Kotlin), lisp, llvm, lua, matlab, ml, mumps, n (Nemerle), pascal, proto, scala, sql, tcl, tex, vb, vhdl, wiki, xq, and yaml.
To create a fenced code block that spans multiple lines of code, set the text inside three or more backquotes (
```
) or tildes (~~~
).Open and close the block with the same character.
Use the same number of characters to open and close the code fence.
Lists
Use the following syntax to create lists:
To create an unordered list, start the line with a dash (
-
), asterisk (*
), or plus sign (+
).To create an ordered list, start the line with a number and a period (
1.
). Increment subsequent numbers to format each item in the ordered list.To nest an unordered list inside an unordered or ordered list, indent the line with two spaces. Nesting ordered lists is not supported.
Tables
Tables are a great tool for adding structure to your content. Use the following syntax to create tables:
To create columns, use vertical bars (
|
). The outer bars are optional.Separate the header row from the rest of the table with three or more dashes (
---
).
Note that the columns don't have to line up perfectly in the raw Markdown. You can also add character formatting to text inside the table.
All of the cells are left-justified. The syntax that aligns text to the right or center is not supported.
Links
There are several ways to insert hyperlinks with Markdown.
Style | Format |
---|---|
Inline | Wrap link text with brackets |
Inline with tooltip | Use inline formatting and add the tooltip in quotation marks after the URL. |
Reference | Replace the URL with an arbitrary, case-insensitive reference, wrapped in brackets |
Hub has also extended the standard syntax to include autolinks.
URLs and URLs in angle brackets are automatically converted into hyperlinks. For example:
https://www.jetbrains.com
<https://www.jetbrains.com>
jetbrains.com
Autolinks
Autolinks are absolute URIs and email addresses that are set inside angle brackets (< >
). They are parsed as links, with the URL or email address as the link label. Unlike links that let you specify link text and tooltips, this syntax simply converts the URL or email address into a clickable link.
Hub supports an extended syntax for URLs. Any string that is parsed as a URL is converted into a clickable link, even without the angle brackets. Email addresses that are not set inside angle brackets are displayed as text.
Images
The syntax for images is similar to the syntax for links. To insert an inline image:
Start the line with an exclamation point (
!
).Wrap the alt text with brackets (
[ ]
).Set the image URL and tooltip in parentheses (
( )
).
You can also use the reference style for images. To insert an image reference:
Start the line with an exclamation point (
!
).Wrap the alt text with brackets (
[ ]
).Set the image reference in brackets (
[ ]
).Define the image reference in another location with the format
[tag]: image URL "tooltip"
.
Backslash Escapes
When you have characters that are parsed as Markdown that you want to show as written, you can escape the character with the backslash (\
).
Backslashes before non-markup characters are shown as backslash characters.
Escaped characters are treated as regular characters. Their usual meaning in Markdown syntax is ignored.
Backslash escapes do not work in fenced code blocks, inline code spans, or autolinks.