diff --git a/Cargo.lock b/Cargo.lock index 24757ce..43d2b8a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1117,7 +1117,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "snekdown" -version = "0.21.0" +version = "0.21.1" dependencies = [ "asciimath-rs 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "base64 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index 388f563..06e09fc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snekdown" -version = "0.21.0" +version = "0.21.1" authors = ["trivernis "] edition = "2018" license-file = "LICENSE" diff --git a/src/parser/mod.rs b/src/parser/mod.rs index 0a17781..c8b1cac 100644 --- a/src/parser/mod.rs +++ b/src/parser/mod.rs @@ -99,6 +99,9 @@ impl Parser { reader .read_to_string(&mut text) .expect("Failed to read file"); + if text.chars().last() != Some('\n') { + text.push('\n'); + } let document = Document::new(!is_child); Self {