Basic markup
Inline formatting
Use the markup methods below to format text fragments within a line.
| Markup | Result |
|---|---|
**Bold text** |
Bold text |
_Italic_ |
Italic |
**_Bold italic_** |
Bold italic |
_**Also bold italic**_ |
Also bold italic |
~~Strikethrough text~~ |
|
Superscript^text^ |
Superscripttext |
##Monospaced text## |
Monospaced text |
{red}(Colored text) |
Colored text |
To use subscript or underlined text, you need to enable additional plugins. For more details, see the section Additional features.
Paragraphs
To create a paragraph, separate one block of text from another with a blank line.
Параграф.
Следующий параграф.
Result:
Paragraph.
Next paragraph.
Line breaks
To break a line, move the caret to a new line.
Строка.
Следующая строка.
Result:
Line.
Next line.
To use two spaces at the end of a line instead of a caret break, set the value breaks: false in the settings.
Headings
The following heading levels are distinguished:
- first level (h1) for the page title;
- second (h2), third (h3), fourth (h4), etc. levels for subsection headings.
# Заголовок h1
## Заголовок h2
### Заголовок h3
#### Заголовок h4
During the build, an anchor is generated for each heading. Anchors allow you to create links that lead to document sections.
By default, an anchor in YFM is the heading text written in Latin transliteration. You can set an anchor manually by specifying it after the heading:
## Заголовок h2 {#anchor-example}
To also generate anchors according to GitHub rules along with YFM-style anchors, set the value supportGithubAnchors: true in the settings.
Warning
First-level headings are used only as page titles.
They have limitations: they do not work with anchors and are not displayed in the page table of contents.
Quotes
To display a quote, use the following markup:
> Цитирование
Result:
Quoting
> Цитирование
>> Вложенное цитирование
Result:
Quoting
Nested quoting
Escaping
To prevent a markup special character from being interpreted, escape it with the character \.
Верхний^регистр^
Верхний\^регистр^
Result:
Superscripttext
Superscript^text^
Comments
Comments are markup elements that are not displayed in the built file. They are used to store information for SEO or document authors in the source text.
To add a comment, use the following markup. Make sure there is a blank line before the comment.
[//]: # (Комментарий)
Using HTML
By default, YFM escapes HTML. To disable escaping, set the value allowHtml: true in the settings.