From bfaad4293afcea32e4d8a1898c564822dbfa5324 Mon Sep 17 00:00:00 2001 From: trivernis Date: Fri, 21 Aug 2020 17:33:59 +0200 Subject: [PATCH] Fix last table row being ignored on eof --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/parser/line.rs | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 448bd9f..35735db 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.22.7" +version = "0.22.8" dependencies = [ "asciimath-rs 0.5.4 (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 109b168..bcdfdec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snekdown" -version = "0.22.7" +version = "0.22.8" authors = ["trivernis "] edition = "2018" license-file = "LICENSE" diff --git a/src/parser/line.rs b/src/parser/line.rs index 0277565..e9373b8 100644 --- a/src/parser/line.rs +++ b/src/parser/line.rs @@ -116,7 +116,9 @@ impl ParseLine for Parser { if self.ctm.check_char(&PIPE) { self.ctm.seek_one()?; } - self.ctm.seek_one()?; + if !self.ctm.check_eof() { + let _ = self.ctm.seek_one(); + } if row.cells.len() > 0 { Ok(row)