Fix quotes and monospace

- Fix parsing of empty quote lines
- Fix style of monospace
pull/1/head
trivernis 5 years ago
parent 03ebed6277
commit 345bde509c

2
Cargo.lock generated

@ -444,7 +444,7 @@ dependencies = [
[[package]] [[package]]
name = "snekdown" name = "snekdown"
version = "0.2.3" version = "0.2.4"
dependencies = [ dependencies = [
"crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "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)", "htmlescape 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",

@ -1,6 +1,6 @@
[package] [package]
name = "snekdown" name = "snekdown"
version = "0.2.3" version = "0.2.4"
authors = ["trivernis <trivernis@protonmail.com>"] authors = ["trivernis <trivernis@protonmail.com>"]
edition = "2018" edition = "2018"
license-file = "LICENSE" license-file = "LICENSE"

@ -26,9 +26,11 @@ code pre {
border-radius: 0.25em; border-radius: 0.25em;
} }
code { code.inlineCode {
font-family: "Fira Code", monospace; font-family: "Fira Code", monospace;
border-radius: 0.1em; border-radius: 0.1em;
background-color: #EEE;
padding: 0 0.1em
} }
.tableWrapper { .tableWrapper {

@ -301,7 +301,7 @@ impl ToHtml for StrikedText {
impl ToHtml for MonospaceText { impl ToHtml for MonospaceText {
fn to_html(&self) -> String { fn to_html(&self) -> String {
format!("<code>{}</code>", self.value.to_html()) format!("<code class='inlineCode'>{}</code>", self.value.to_html())
} }
} }

@ -417,7 +417,7 @@ impl Parser {
while self.check_special(&QUOTE_START) while self.check_special(&QUOTE_START)
&& self.next_char() != None && 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 let Ok(text) = self.parse_text() {
if text.subtext.len() > 0 { if text.subtext.len() > 0 {

Loading…
Cancel
Save