From 345bde509cbedb3308be40904788a05a7035e3e8 Mon Sep 17 00:00:00 2001 From: trivernis Date: Sun, 31 May 2020 12:20:05 +0200 Subject: [PATCH] Fix quotes and monospace - Fix parsing of empty quote lines - Fix style of monospace --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/format/assets/style.css | 4 +++- src/format/html.rs | 2 +- src/parser.rs | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3245ed5..1427f08 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -444,7 +444,7 @@ dependencies = [ [[package]] name = "snekdown" -version = "0.2.3" +version = "0.2.4" dependencies = [ "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "htmlescape 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index e12cd0e..9f5b4b8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snekdown" -version = "0.2.3" +version = "0.2.4" authors = ["trivernis "] edition = "2018" license-file = "LICENSE" diff --git a/src/format/assets/style.css b/src/format/assets/style.css index 0212d26..4aba92f 100644 --- a/src/format/assets/style.css +++ b/src/format/assets/style.css @@ -26,9 +26,11 @@ code pre { border-radius: 0.25em; } -code { +code.inlineCode { font-family: "Fira Code", monospace; border-radius: 0.1em; + background-color: #EEE; + padding: 0 0.1em } .tableWrapper { diff --git a/src/format/html.rs b/src/format/html.rs index 86be710..e30cc87 100644 --- a/src/format/html.rs +++ b/src/format/html.rs @@ -301,7 +301,7 @@ impl ToHtml for StrikedText { impl ToHtml for MonospaceText { fn to_html(&self) -> String { - format!("{}", self.value.to_html()) + format!("{}", self.value.to_html()) } } diff --git a/src/parser.rs b/src/parser.rs index ae5f8f6..3b29485 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -417,7 +417,7 @@ impl Parser { while self.check_special("E_START) && self.next_char() != None - && self.check_seek_inline_whitespace() + && (self.check_seek_inline_whitespace() || self.check_special(&LB)) { if let Ok(text) = self.parse_text() { if text.subtext.len() > 0 {