Escape special markdown characters for literal display.
Markdown uses special characters for formatting. To display these characters literally, you need to escape them with a backslash (\).
The following characters have special meaning in markdown and may need escaping:
| Character | Purpose | Escaped | Example |
|---|---|---|---|
\ |
Escape character | \\ |
Use \\ to show backslash |
` |
Inline code | \` |
Show \`backticks\` |
* |
Emphasis, lists | \* |
Literal \*asterisk\* |
_ |
Emphasis | \_ |
File\_name\_here |
{} |
Attributes | \{\} |
Show \{object\} |
[] |
Links, images | \[\] |
Array\[index\] |
() |
Link URLs | \(\) |
Function\(\) call |
# |
Headings | \# |
Tag \#hashtag |
+ |
Lists | \+ |
Math: 5 \+ 3 |
- |
Lists, hr | \- |
Range: 1\-10 |
. |
Ordered lists | \. |
1\. Not a list |
! |
Images | \! |
Alert\! Message |
my\_file\_name.txtarray\[0\], function\(\)5 \* 3 \+ 2\#trendingCharacters often don't need escaping in certain contexts:
under_score often doesn't need escapingTwo alternatives to escaping:
Use `array[0]` to access elements.
```
function hello() {
return "No *escaping* needed!";
}
```
Escape with backslash:
\\ Backslash
\` Backtick
\* Asterisk
\_ Underscore
\{ Brace
\[ Bracket
\( Parenthesis
\# Hash
\+ Plus
\- Minus
\. Dot
\! Exclamation
File names:
file\_name\_v2.txt
Code refs:
array\[0\]
Math:
2 \* 3 \+ 5
Hashtags:
\#trending