Fix problems with missing newline at eof

feature/epub-rendering
trivernis 4 years ago
parent 038a9ef554
commit 6739851aba

2
Cargo.lock generated

@ -1117,7 +1117,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "snekdown" name = "snekdown"
version = "0.21.0" version = "0.21.1"
dependencies = [ dependencies = [
"asciimath-rs 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "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)", "base64 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)",

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

@ -99,6 +99,9 @@ impl Parser {
reader reader
.read_to_string(&mut text) .read_to_string(&mut text)
.expect("Failed to read file"); .expect("Failed to read file");
if text.chars().last() != Some('\n') {
text.push('\n');
}
let document = Document::new(!is_child); let document = Document::new(!is_child);
Self { Self {

Loading…
Cancel
Save