From 54f531a0a836f07ef54cc036fa6ba4d3801ff4ff Mon Sep 17 00:00:00 2001 From: jordan@doyle.la Date: Thu, 23 Jul 2020 15:15:57 +0100 Subject: [PATCH] Fixes #16: New lines lost when only a \n is given --- 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 +++ a/Cargo.lock @@ -1074,7 +1074,7 @@ [[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 @@ [[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 @@ [[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 +++ a/src/main.rs @@ -111,7 +111,7 @@ // Add tags to enable line numbering with CSS let html = format!( "{}", - code_highlighted.replace("\n", "") + code_highlighted.replace("\n", "\n") ); let content = MarkupDisplay::new_safe(Cow::Borrowed(&html), AskamaHtml); -- rgit 0.1.3