Backslash escapes
Any ASCII punctuation character may be backslash-escaped:
Example 308
Markdown | HTML | Demo |
---|---|---|
|
|
Backslashes before other characters are treated as literal backslashes:
Example 309
Markdown | HTML | Demo |
---|---|---|
|
|
Escaped characters are treated as regular characters and do not have their usual Markdown meanings:
Example 310
Markdown | HTML | Demo |
---|---|---|
|
|
If a backslash is itself escaped, the following character is not:
Example 311
Markdown | HTML | Demo |
---|---|---|
|
|
A backslash at the end of the line is a hard line break:
Example 312
Markdown | HTML | Demo |
---|---|---|
|
|
Backslash escapes do not work in code blocks, code spans, autolinks, or raw HTML:
Example 313
Markdown | HTML | Demo |
---|---|---|
|
|
Example 314
Markdown | HTML | Demo |
---|---|---|
|
|
Example 315
Markdown | HTML | Demo |
---|---|---|
|
|
Example 316
Markdown | HTML | Demo |
---|---|---|
|
|
Example 317
Markdown | HTML | Demo |
---|---|---|
|
|
But they work in all other contexts, including URLs and link titles, link references, and info strings in fenced code blocks:
Example 318
Markdown | HTML | Demo |
---|---|---|
|
|
Example 319
Markdown | HTML | Demo |
---|---|---|
|
|
Example 320
Markdown | HTML | Demo |
---|---|---|
|
|