properly escape content

This commit is contained in:
Hayden 2022-10-01 20:50:05 -08:00
parent 1e8b17bb89
commit c39b778234
2 changed files with 9 additions and 1 deletions

View file

@ -80,6 +80,10 @@ impl Pasta {
pub fn content_not_highlighted(&self) -> String {
html_highlight(&self.content, "txt")
}
pub fn content_escaped(&self) -> String {
self.content.replace("`", "\\`").replace("$", "\\$")
}
}
impl fmt::Display for Pasta {