From 5efb355a069b4c0fae38cc7fb2e3597fee62f7e8 Mon Sep 17 00:00:00 2001 From: trivernis Date: Sun, 31 May 2020 10:12:40 +0200 Subject: [PATCH] Fix import parsing --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/parser.rs | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e0ca5a2..a8294f5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -153,7 +153,7 @@ dependencies = [ [[package]] name = "snekdown" -version = "0.1.1" +version = "0.1.2" dependencies = [ "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "htmlescape 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index b17822a..b086de6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snekdown" -version = "0.1.1" +version = "0.1.2" authors = ["trivernis "] edition = "2018" license-file = "LICENSE" diff --git a/src/parser.rs b/src/parser.rs index fef4149..ae5f8f6 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -478,7 +478,10 @@ impl Parser { if self.check_linebreak() || path.is_empty() { return Err(self.revert_with_error(start_index)); } - parse_option!(self.next_char(), self.index); + if self.check_special(&IMPORT_CLOSE) { + parse_option!(self.next_char(), self.index); + } + self.seek_whitespace(); if let Ok(anchor) = self.import_document(path.clone()) { Ok(Import { path, anchor })