Skip to content

Commit

Permalink
Fixes #16: New lines lost when only a \n is given
Browse files Browse the repository at this point in the history
  • Loading branch information
w4 committed Jul 23, 2020
1 parent 598baa2 commit 54f531a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 54f531a

Please sign in to comment.