🏡 index : ~doyle/bin.git

author jordan@doyle.la <jordan@doyle.la> 2020-07-23 14:15:57.0 +00:00:00
committer jordan@doyle.la <jordan@doyle.la> 2020-07-23 14:15:57.0 +00:00:00
commit
54f531a0a836f07ef54cc036fa6ba4d3801ff4ff [patch]
tree
84d8340ca1840f139c428b933f71dc8b180849d8
parent
598baa2acef23ad62a98edab6c31f00da6589597
download
54f531a0a836f07ef54cc036fa6ba4d3801ff4ff.tar.gz

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



Diff

 Cargo.lock  | 6 +++---
 src/main.rs | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock
index 19099a4..4c720d6 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1074,7 +1074,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rocket"
version = "0.5.0-dev"
source = "git+https://github.com/SergioBenitez/Rocket?branch=master#56a617262525de758cb47a0d71049db948f24bbd"
source = "git+https://github.com/SergioBenitez/Rocket?branch=master#adc79016cdfe732a6c095dd96aa5286a70c4d3be"
dependencies = [
 "async-trait 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
 "atomic 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1099,7 +1099,7 @@ dependencies = [
[[package]]
name = "rocket_codegen"
version = "0.5.0-dev"
source = "git+https://github.com/SergioBenitez/Rocket?branch=master#56a617262525de758cb47a0d71049db948f24bbd"
source = "git+https://github.com/SergioBenitez/Rocket?branch=master#adc79016cdfe732a6c095dd96aa5286a70c4d3be"
dependencies = [
 "devise 0.3.0 (git+https://github.com/SergioBenitez/Devise.git?rev=1e42a2691)",
 "glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1111,7 +1111,7 @@ dependencies = [
[[package]]
name = "rocket_http"
version = "0.5.0-dev"
source = "git+https://github.com/SergioBenitez/Rocket?branch=master#56a617262525de758cb47a0d71049db948f24bbd"
source = "git+https://github.com/SergioBenitez/Rocket?branch=master#adc79016cdfe732a6c095dd96aa5286a70c4d3be"
dependencies = [
 "cookie 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)",
 "http 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
diff --git a/src/main.rs b/src/main.rs
index d39145c..c36cca6 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -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);