Fixes #16: New lines lost when only a \n is given

This commit is contained in:
jordan@doyle.la 2020-07-23 15:15:57 +01:00
parent 598baa2ace
commit 54f531a0a8
No known key found for this signature in database
GPG key ID: 1EA6BAE6F66DC49A
2 changed files with 4 additions and 4 deletions

View file

@ -111,7 +111,7 @@ async fn show_paste(key: String, plaintext: IsPlaintextRequest) -> Result<Conten
// Add <code> tags to enable line numbering with CSS
let html = format!(
"<code>{}</code>",
code_highlighted.replace("\n", "</code><code>")
code_highlighted.replace("\n", "\n</code><code>")
);
let content = MarkupDisplay::new_safe(Cow::Borrowed(&html), AskamaHtml);