Escaping mechanism
The character set generally available for plain text documents is limited. For example, individual markup characters can already have a meaning in the written text and appear in the text without being intended as markup. To obtain the standard meaning of the characters used for the markup, there is an escaping mechanism in reStructuredText. A backslash ("\") is used as escape character.
The following applies:
- A backslash followed by any character (except for spaces in non-URI contexts) causes the character to represent the character itself and plays no role in the interpretation of markups. The backslash is removed from the output.
- A literal backslash is represented by two backslashes in a row.
- In non-URI contexts, a backslash followed by a space is removed from the comment. This allows inline marking at character level (see Inline markup at character level).
- There are two contexts in which backslashes have no special meaning: code blocks and inline literals. In these contexts a single backslash represents a literal backslash without having to be duplicated (see Codeblock).