Add optional comma to metadata

pull/1/head
trivernis 5 years ago
parent 815bd26e51
commit 63345854a0

2
Cargo.lock generated

@ -566,7 +566,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "snekdown" name = "snekdown"
version = "0.15.1" version = "0.15.2"
dependencies = [ dependencies = [
"chrono 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)",
"colored 1.9.3 (registry+https://github.com/rust-lang/crates.io-index)", "colored 1.9.3 (registry+https://github.com/rust-lang/crates.io-index)",

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

@ -172,7 +172,7 @@ Bibliography entries can be defined and referenced anywhere in the document.
Definition: Definition:
```md ```md
[book]:[author=Snek title = "Snekdown Book"] [book]:[author=Snek, title = "Snekdown Book"]
[github]: https://github.com/trivernis/snekdown [github]: https://github.com/trivernis/snekdown
``` ```

@ -454,6 +454,10 @@ impl Parser {
if self.check_special_group(&QUOTES) { if self.check_special_group(&QUOTES) {
self.skip_char(); self.skip_char();
} }
self.seek_inline_whitespace();
if self.check_special(&COMMA) {
self.skip_char();
}
value = if quoted_string { value = if quoted_string {
MetadataValue::String(raw_value) MetadataValue::String(raw_value)
} else if raw_value.to_lowercase().as_str() == "true" { } else if raw_value.to_lowercase().as_str() == "true" {

@ -31,6 +31,7 @@ pub(crate) const SEMICOLON: char = ';';
pub(crate) const R_BRACE: char = '{'; pub(crate) const R_BRACE: char = '{';
pub(crate) const L_BRACE: char = '}'; pub(crate) const L_BRACE: char = '}';
pub(crate) const PERCENT: char = '%'; pub(crate) const PERCENT: char = '%';
pub(crate) const COMMA: char = ',';
// aliases // aliases

Loading…
Cancel
Save