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]]
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)",

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

@ -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 {

Loading…
Cancel
Save