Basic markup

Line formatting

Use the markup methods below to format a text fragment in a line.

Markup Result
**Bold text** Bold text
_Italic_ Italic
**_Bold italic_** Bold italic
_**Also bold italic**_ Also bold italic
~~Strikethrough text~~ Strikethrough text
Super^script^ Superscript
##Monospaced text## Monospaced text

To use subscript or underlined text, you need to add additional plugins. For more information, see Additional features.

Headers

There are 4 levels of headers:

  • The first level (h1) is for the page header (title).
  • The second (h2), third (h3), and fourth (h4) levels are for subsection headers.
# h1 header
## h2 header
### h3 header
#### h4 header

During the build, an anchor is created for each header. Anchors allow you to create links to document sections.

By default, the anchor in YFM is the header text written in Latin letters. You can set the anchor manually by specifying it after the header:

## h2 header {#anchor}

To simultaneously generate anchors following GitHub rules with the YFM anchors, in the settings, set supportGithubAnchors: true.

Paragraphs

To create a paragraph, separate one block of text from another with an empty line.

Paragraph.

Next paragraph.

Result

Paragraph.

Next paragraph.

Line breaks

To move a line, move the carriage.

Line.
Next line.

Result

Line.
Next line.

To use two spaces at the end of the line instead of a carriage return, in the settings, set breaks: false.

Quotes

> Quote

Result

Quote

> Quote
>> Nested quotes

Result

Quote

Nested quotes

Escaping

To prevent a markup syntax symbol from being interpreted, escape it with the \ symbol.

Super^script^
Super\^script^

Result

Superscript
Super^script^

Using HTML

By default, YFM escapes HTML. To disable escaping, in the settings, set allowHTML: true.

Previous
Next