GitLab Flavored Markdown

A cheat sheet for GLFM: task lists, math, diagrams, references, and GitLab-only extras

Quick answer

GitLab Flavored Markdown supports everything in GitHub Flavored Markdown plus GitLab-only features: [[_TOC_]] for a table of contents, color chips like `#FF5733`, math with $`...`$, Mermaid/PlantUML diagrams, and references such as #123, !123, and @user.

Text & Standard Syntax

Bold

Standard Markdown bold

**bold text**

Italic

Standard Markdown italic

*italic text*

Strikethrough

GFM strikethrough

~~strikethrough~~

Inline code

Single backticks

`code`

Heading

Up to six levels

# Heading

GitLab-Specific Extensions

Table of contents

Auto-generated TOC from headings

[[_TOC_]]

Task list

Interactive checkboxes in issues and MRs

- [x] Done
- [ ] Todo

Color chip

Hex, RGB, or HSL codes render a color swatch

`#FF5733`

Footnote

Reference-style footnotes

Text[^1]

[^1]: The note.

Multiline blockquote

Fence a quote with >>>

>>>
Multi-paragraph
quote
>>>

Math & Diagrams

Inline math

KaTeX inline math

$`a^2 + b^2 = c^2`$

Math block

Fenced math block

```math
\sum_{i=1}^{n} i
```

Mermaid diagram

Flowcharts and diagrams

```mermaid
graph TD
  A --> B
```

PlantUML

UML diagrams (if enabled)

```plantuml
Bob -> Alice : hello
```

References & Links

Issue reference

Auto-links to issue 123

#123

Merge request

Auto-links to merge request 123

!123

User mention

Mentions and notifies a user

@username

Label

References a project label

~label

Emoji

GitLab emoji shortcodes

:thumbsup:

Frequently Asked Questions

What is GitLab Flavored Markdown?

GitLab Flavored Markdown (GLFM) is GitLab’s Markdown dialect. It builds on CommonMark and GitHub Flavored Markdown and adds GitLab-specific features such as [[_TOC_]], color chips, references like #123 and !123, math, and Mermaid/PlantUML diagrams.

How do I add a table of contents in GitLab?

Insert [[_TOC_]] on its own line, or use the [TOC] tag in wikis. GitLab builds the table of contents automatically from the headings on the page.

How do I write math in GitLab Markdown?

Use $`...`$ for inline math and a fenced ```math block for display math. GitLab renders both with KaTeX.

Do color chips work in GitLab?

Yes. When you write a color code inside backticks, such as `#FF5733`, `rgb(255,87,51)`, or `hsl(9,100%,60%)`, GitLab shows a small color swatch next to the code.

Does GitLab render Mermaid diagrams?

Yes. Put your diagram in a fenced code block with the mermaid language, and GitLab renders it inline in issues, merge requests, wikis, and Markdown files.

Related Guides