Difference between revisions of "Discord/formatting"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search
Line 27: Line 27:
 
* <code>&gt;&gt;&gt;</code> escapes emoji (haven't had time to explore in order to describe it precisely)
 
* <code>&gt;&gt;&gt;</code> escapes emoji (haven't had time to explore in order to describe it precisely)
 
==Previews==
 
==Previews==
To display a link without Discord also inserting a preview, surround the URL with angle brackets: &lt;<nowiki>https://htyp.org</nowiki>&gt;. The angle brackets will not be displayed, and preview will be suppressed.
+
To display a link without Discord also inserting a preview, surround the URL with angle brackets: &lt;<nowiki>https://htyp.org</nowiki>&gt;. The angle brackets will not be displayed, and preview will be suppressed, but the URL will be presented as a link.
 
* Note: Discord's settings refer to the preview as an "embedded link". Previews of links pasted into a discussion can be turned off by revoking this privilege.
 
* Note: Discord's settings refer to the preview as an "embedded link". Previews of links pasted into a discussion can be turned off by revoking this privilege.

Revision as of 13:14, 22 February 2022

Discord text formatting

Text formatting is similar to a subset of Markdown, although there are differences:

  • bold is **two asterisks**
  • italic is *one asterisk* or _one underscore_
    • They are rendered exactly the same (using <em>) but parsed differently: "a*b*c" becomes abc but a_b_c is left unformatted.
  • underline is __two underscores__
  • strike is ~~two tildes~~
  • code (fixed-pitch inline unformatted text) is `backticks`
    • You can use this format to paste URLs without them becoming links or displaying a preview.
    • There's a better way to just suppress previews, however: see #Previews.
  • multiple lines of code can be started with three backticks at the beginning of a line:
```
code lines
code lines
```
  • the initial backticks can have a language designator afterwards, for syntax highlighting:
```php
php code...
```
  • > (right-angle plus a space) will cause the following paragraph to be indented with a vertical bar
  • spoiler text is ||two pipes||: this causes the text to be obscured until clicked on (similar to this but requiring a click rather than mouse-hover)

To display characters that would otherwise be treated as formatting, escape them with a backslash:

  • \* will display as *
  • \_ will display as _
  • This does not seem to work with backticks (`), however.
  • >>> escapes emoji (haven't had time to explore in order to describe it precisely)

Previews

To display a link without Discord also inserting a preview, surround the URL with angle brackets: <https://htyp.org>. The angle brackets will not be displayed, and preview will be suppressed, but the URL will be presented as a link.

  • Note: Discord's settings refer to the preview as an "embedded link". Previews of links pasted into a discussion can be turned off by revoking this privilege.