• Skip to main content
  • Skip to primary sidebar

Technipages

Tutorials and fixes for smartphone, gadget, and computer problems

  • Topics
    • Android
    • Browsers
    • Gaming
    • Hardware
    • Internet
    • iPhone
    • Linux
    • macOS
    • Office
    • Reviews
    • Software
    • Windows
    • Definitions
  • Product Reviews
  • Downloads
  • About
Discord: How to Use Code Blocks

Discord: How to Use Code Blocks

November 24, 2020 by Mel Hawthorne 1 Comment

In Discord, you can separate text and make it really stand out with the use of code blocks. Code blocks change the background of the affected text but leave the overall formatting of the text alone by default.

A code block is denoted through the use of backticks “`”, with a single backtick on each side being used for a single-line code block, and triple backticks being used on either side for multi-line code blocks. As the name suggests, multi-line code blocks can contain multiple lines of code. Single-line code blocks can’t include multiple lines, although they can wrap over onto multiple lines if the text is too long to display on a single line.

Tip: One thing you may notice when using a multi-line code block is that if your cursor is inside the code block when you hit enter, a new line will be inserted rather than the message being sent. This also applies if you have not yet closed the code block. Multi-line code blocks are the only styling type that affects the text in the message box without needing the closing syntax to already be present.

Single-line code blocks use a single backtick on either side, while multi-line code blocks use triple backticks.

Any emphasis styling included within a code block will be printed literally rather than being interpreted. For example, the pair of asterisks used to italicise text would be visible and would not apply the italic styling. To apply styling effects, you need to put the styling syntax outside of the code block.

Text styling effects need to be applied outside the code block to apply to it, otherwise, the syntax is printed literally.

You can also apply colour formatting to a multi-line code block by specifying a programming language at the start, directly after the opening triple backticks. The colours and the syntax required for those colours will vary between languages. Only certain languages are supported, unfortunately, Discord does not publish a list of supported languages and the associated syntax for colours. A list of known languages and examples of the colours they offer can be found here.

You can apply programming-language-based colouring by specifying supported languages directly after the opening triple backticks.

You Might Also Like

  • How to Set up a Group DM in Discord
    How to Set up a Group DM in Discord
  • How to Add a Bot to a Discord Server
    How to Add a Bot to a Discord Server
  • How to Invite Someone to Discord
    How to Invite Someone to Discord
  • How to Add a Friend in Discord
    How to Add a Friend in Discord
  • Discord: How to Use Blockquotes
    Discord: How to Use Blockquotes
  • Can't Uninstall Discord From Windows
    Can't Uninstall Discord From Windows

Filed Under: Software

Reader Interactions

Comments

  1. Linda says

    September 6, 2022 at 9:03 am

    Which syntaxes are supported?

Did this help? Let us know!

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Recent Posts

  • How to Enable Dark Mode on Microsoft Teams
  • How to Easily Fix Google Maps Not Working for Android
  • How to Fix ChatGPT Network Error
  • Android TV: How to Check App Storage
  • How to Use Reader Mode on Chrome and Firefox
  • How to Translate Messages on Android
  • How to Customize Buttons on ASUS ROG Ally
  • How to Change Graphics Settings on Steam Deck

Who’s Behind Technipages?

Baby and Daddy My name is Mitch Bartlett. I've been working in technology for over 20 years in a wide range of tech jobs from Tech Support to Software Testing. I started this site as a technical guide for myself and it has grown into what I hope is a useful reference for all.

© Copyright 2023 Guiding Tech Media · All Rights Reserved · Privacy