escape
Escapes text so that Markdown shows it literally instead of interpreting it.
A backslash is put before every character that can start emphasis, code, a link, a tag, a table
cell or a strikethrough (\ ` * _ [ ] < > | ~ &), and before the characters that only
matter at the start of a line: #, +, -, =, and the . or ) of 1. / 1) list
markers. Escaping more than strictly needed is harmless (the Markdown spec accepts a backslash before
any ASCII punctuation) and keeps this predictable. Use it for text you do not control that you
put into a Markdown document, such as a user name or an error message.
Import
Section titled “Import”Cargo feature markdown (enabled by default). To compile only this module:
or in Cargo.toml:
Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
text | &str | The text to escape, on one or several lines. |
Returns
Section titled “Returns”String — The escaped text.
