A tool for easily extracting front matter out of a string. It is a fast Rust implementation of gray-matter. Parses YAML, JSON, TOML and support for custom parsers. Use it and let me know by giving it a star!
In engines/toml.rs (and similar in the other engines)
impl Engine for TOML {
fn parse(content: &str) -> Pod {
match toml::from_str::<Value>(content) {
Ok(value) => value.into(),
Err(_) => Pod::Null,
}
}
}
This makes it more difficult to troubleshoot issues with front matter parsing, since any internal error thrown by the parser is completely hidden. It would be nice if the Pod enum instead contained an error state containing whatever error type the internal parser uses. (Or something like that, I'm no expert)
In
engines/toml.rs
(and similar in the other engines)This makes it more difficult to troubleshoot issues with front matter parsing, since any internal error thrown by the parser is completely hidden. It would be nice if the Pod enum instead contained an error state containing whatever error type the internal parser uses. (Or something like that, I'm no expert)