Skip to content

Instantly share code, notes, and snippets.

@matthewzring
Last active April 30, 2024 09:36
Show Gist options
  • Save matthewzring/9f7bbfd102003963f9be7dbcf7d40e51 to your computer and use it in GitHub Desktop.
Save matthewzring/9f7bbfd102003963f9be7dbcf7d40e51 to your computer and use it in GitHub Desktop.
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers:

Text Formatting

Italics *italics* or _italics_

Underline italics __*underline italics*__

Bold **bold**

Underline bold __**underline bold**__

Bold Italics ***bold italics***

underline bold italics __***underline bold italics***__

Underline __underline__

Strikethrough ~~Strikethrough~~

Don't want to use markdown? You can slap a backslash in front of your statement, or put your message in a code block, and it'll escape the markdown formatting. You'll see those asterisks as you'd like!

Organizational Text Formatting

Headers

To create a header, you need to include a specific number of the hash/pound sign character (#). Use (#) for a big header, (##) for a smaller header, or (###) for an even smaller header as the first character(s) in a new line.

headers

Masked Links

You can use masked links to make text a clickable or pressable hyperlink. To do so, you need to include the text you want displayed in brackets and then the URL in parentheses. For example:

masked links

If you don't wish to embed a link, you can wrap the link with <> to remove the embed for that specific link.

Unordered Lists

You can create a bulleted list using either (-) or (*) in the beginning of each line. You can indent your list by adding a space before (-) or (*) at the beginning of each line.

unordered lists

Ordered Lists

To create an ordered list, add line items with numbers followed by periods. The numbers don't have to be in numerical order, but the list will always start with the first number. You can indent your list by adding a space before the number at the beginning of each line.

ordered lists

Code Blocks

Discord also supports code blocks as well. You can make your own code blocks by wrapping your text in backticks (`)

one line code blocks

You can also use three backticks (```) to create multiline code blocks, like this beautifully written haiku.

multiline code blocks

Block Quotes

The syntax to use Block Quotes is > or >>> followed by a space.

> at the beginning of a line of text, creates a single-line block quote.

one line block quote

>>> at the beginning of a line of text, creates a multi-line block quote. All text from >>> until the end of the message will be included in the quote.

multiline block quote

Spoiler Tags

You can manually tag spoilers by using the syntax || around your text or by typing /spoiler before your message. This is also negated by a code block.

spoiler tags

Syntax Highlighting

If you really want to spruce up your code blocks, you can denote a specific language for syntax highlighting, by typing the name of the language you want the code block to expect right after the first three backticks beginning your code block. An example...

syntax highlighting

There are many different languages in place of Markdown that Discord's syntax highlighting support. Each different language has its own approach to highlight-able syntax. Note that you won't be able to view syntax highlighting on the mobile app.

asciidoc

asciidoc

autohotkey

autohotkey

bash

bash

coffeescript

coffeescript

cpp (C++)

cpp

cs (C#)

cs

css

css

diff

diff

fix

fix

glsl

glsl

ini

ini

json

json

md (markdown)

md

ml

ml

prolog

prolog

ps

ps

py

py

tex

tex

xl

xl

xml

xml

yaml

yaml

And you get the idea! Now you're a Discord text markdown expert. Get out there and highlight your statements!

Acknowledgements

Discord
Discord Highlight.js

If you have any questions or want to get in contact with me, you can add matthewzring on Discord or join my discord server.

@kkrypt0nn
Copy link

no checkoff list?

Nope

@Andre601
Copy link

2 things regarding syntax highlighting:

  1. The link to highlightjs redirects to a info page telling that they aren't a CDN... So maybe remove it. Especially because...
  2. Discord switched over to highlight colours from GitHub. Not sure if that actually also changes the highlighter used tho. Still think it's better to remove the link...

@matthewzring
Copy link
Author

@Andre601 Fixed, thanks!

@Tier-ng
Copy link

Tier-ng commented Oct 28, 2023

The markdown for c# seems to work perfectly while typing up the message, but once I send it it just becomes plain white text. Am I missing something?

@Polda18
Copy link

Polda18 commented Nov 10, 2023

Is there a way I can send messages in Discord with keyboard keys markup, like <kbd>Ctrl</kbd> <kbd>S</kbd>Ctrl S?

@kkrypt0nn
Copy link

Is there a way I can send messages in Discord with keyboard keys markup, like <kbd>Ctrl</kbd> <kbd>S</kbd> → Ctrl S?

No

@wmantly
Copy link

wmantly commented Nov 13, 2023

Where can bugs for the pre-formated block be reported? On mobile, it should NOT wrap lines in a pre-formated block

@Andre601
Copy link

Andre601 commented Feb 4, 2024

A small thing I would like to point out on (un)ordered lists:

Just like normal markdown can you have multi-line entries by indenting each new line with spaces (Not sure if one is enough here. I always do two, even for nested lists).

So as an example:

- Line1
  Line2

would result in
grafik

@Andre601
Copy link

Andre601 commented Feb 4, 2024

Also, Java seems to be missing from the list, so here is a quick rundown of the different options:
grafik

Some quick notes I want to share:

  • As with other languages (probably), this one turns specific keywords (public, private, static, etc.) red, as you can see with the new keyword.
  • The Red red is only colored when a = is followed with the first word being red.
  • The text after @ can be anything... I just did it like that with the () for consistency.
  • /* ... */ also work as comments, just with multiline.

@SyloTV
Copy link

SyloTV commented Mar 9, 2024

amazing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment