Take a character vector containing punctuation and return a glue vector with every punctuation mark prepended with double escape backslashes.

md_escape(x)

Arguments

x

A character vector of strings containing punctuation that might accidentally be considered markdown syntax.

Value

A character string with all [:punct:] properly escaped with prepended backslashes.

Details

When trying to format text containing markdown syntax characters, it's necessary to "escape" those characters so that they are ignored by formatting.

Any ASCII punctuation character may be backslash-escaped... Escaped characters are treated as regular characters and do not have their usual Markdown meanings.

See also

Examples

md_escape("# six seasons and a movie")
#> \# six seasons and a movie