Fix last line of the file not being parsed

feature/epub-rendering
trivernis 4 years ago
parent c6e2a2560a
commit b835f900eb

2
Cargo.lock generated

@ -1117,7 +1117,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "snekdown"
version = "0.21.2"
version = "0.21.3"
dependencies = [
"asciimath-rs 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"base64 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)",

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

@ -12,7 +12,6 @@ body {
padding: 2rem;
margin: auto;
background-color: #FFF;
box-shadow: 1em 1em 1em gray;
}
h1 {

@ -154,9 +154,10 @@ impl ParseLine for Parser {
}
if self.ctm.check_char(&LB) {
self.ctm.seek_one()?;
if self.ctm.check_char(&LB) {
text.add_subtext(Inline::LineBreak)
if let Ok(_) = self.ctm.seek_one() {
if self.ctm.check_char(&LB) {
text.add_subtext(Inline::LineBreak)
}
}
}

Loading…
Cancel
Save