Fix import parsing

pull/1/head
trivernis 5 years ago
parent d43410de70
commit 5efb355a06

2
Cargo.lock generated

@ -153,7 +153,7 @@ dependencies = [
[[package]] [[package]]
name = "snekdown" name = "snekdown"
version = "0.1.1" version = "0.1.2"
dependencies = [ dependencies = [
"crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "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)", "htmlescape 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",

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

@ -478,7 +478,10 @@ impl Parser {
if self.check_linebreak() || path.is_empty() { if self.check_linebreak() || path.is_empty() {
return Err(self.revert_with_error(start_index)); 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()) { if let Ok(anchor) = self.import_document(path.clone()) {
Ok(Import { path, anchor }) Ok(Import { path, anchor })

Loading…
Cancel
Save