aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rst/src/main.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/rst/src/main.rs b/rst/src/main.rs
index 318bcb6..1012ed1 100644
--- a/rst/src/main.rs
+++ b/rst/src/main.rs
@@ -36,7 +36,8 @@ fn main() -> CliResult {
args.verbosity.setup_env_logger("rst")?;
// TODO: somehow make it work without replacing tabs
- let content = read_file(args.file)?.replace('\t', " ".repeat(8).as_ref());
+ let mut content = read_file(args.file)?.replace('\t', " ".repeat(8).as_ref());
+ if !content.ends_with('\n') { content.push('\n'); } // Allows less complex grammar
let document = parse(&content)?;
let stdout = std::io::stdout();
match args.format {