fix(markdown): add missing char to escape

This commit is contained in:
Ruben Smidt 2020-02-27 21:21:35 +01:00
parent bc98de395d
commit f3d0570ef4

View file

@ -97,6 +97,7 @@ pub fn escape(s: &str) -> String {
.replace(")", r"\)")
.replace("~", r"\~")
.replace("`", r"\`")
.replace(">", r"\>")
.replace("#", r"\#")
.replace("+", r"\+")
.replace("-", r"\-")
@ -218,8 +219,8 @@ mod tests {
fn test_escape() {
assert_eq!(escape("* foobar *"), r"\* foobar \*");
assert_eq!(
escape(r"_ * [ ] ( ) ~ \ ` # + - = | { } . !"),
r"\_ \* \[ \] \( \) \~ \ \` \# \+ \- \= \| \{ \} \. \!",
escape(r"_ * [ ] ( ) ~ \ ` > # + - = | { } . !"),
r"\_ \* \[ \] \( \) \~ \ \` \> \# \+ \- \= \| \{ \} \. \!",
);
}