Merge pull request #70 from hay-kot/feat/implement-copy-button

feat: add copy button to viewer
This commit is contained in:
Dániel Szabó 2022-10-22 21:42:51 +03:00 committed by GitHub
commit 3e58ba325a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 48 additions and 6 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 {