diff --git a/Cargo.lock b/Cargo.lock index 0b3ff0c..7b03459 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,7 +23,7 @@ dependencies = [ [[package]] name = "asciimath-rs" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "charred 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1117,9 +1117,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "snekdown" -version = "0.22.4" +version = "0.22.5" dependencies = [ - "asciimath-rs 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "asciimath-rs 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "base64 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", "charred 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1559,7 +1559,7 @@ dependencies = [ "checksum adler 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" "checksum aho-corasick 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)" = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86" "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" -"checksum asciimath-rs 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4f6f636173df59efb192a0f523cc59929ac8bceaa9d7b8eca20bff60d3dab180" +"checksum asciimath-rs 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4df8571c21e869a1fcd28b29839626e4e7635ad845e588fc361df1bc1d089182" "checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" "checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" "checksum base64 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" diff --git a/Cargo.toml b/Cargo.toml index 390c4a2..a8e0961 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snekdown" -version = "0.22.4" +version = "0.22.5" authors = ["trivernis "] edition = "2018" license-file = "LICENSE" @@ -32,7 +32,7 @@ notify = "4.0.12" toml = "0.5.6" serde ="1.0.111" serde_derive = "1.0.111" -asciimath-rs = "0.5.1" +asciimath-rs = "0.5.2" reqwest = {version = "0.10", features=["blocking"]} mime_guess = "2.0.3" mime = "0.3.16" diff --git a/src/parser/block.rs b/src/parser/block.rs index 26efa38..0d64648 100644 --- a/src/parser/block.rs +++ b/src/parser/block.rs @@ -207,7 +207,7 @@ impl ParseBlock for Parser { } /// parses a list which consists of one or more list items - /// The parser is done iterative to resolve nested items + /// The parsing is done iterative to resolve nested items fn parse_list(&mut self) -> ParseResult { let mut list = List::new(); let start_index = self.ctm.get_index(); diff --git a/src/references/configuration/config.rs b/src/references/configuration/config.rs index 4fe8c31..31c992c 100644 --- a/src/references/configuration/config.rs +++ b/src/references/configuration/config.rs @@ -18,4 +18,5 @@ pub struct MetaConfig { pub(crate) author: Option, pub(crate) date: Option, pub(crate) title: Option, + pub(crate) language: Option, } diff --git a/src/references/configuration/keys.rs b/src/references/configuration/keys.rs index 495761b..314a592 100644 --- a/src/references/configuration/keys.rs +++ b/src/references/configuration/keys.rs @@ -5,3 +5,4 @@ pub const BIB_HIDE_UNUSED: &str = "bib-hide-unused"; pub const META_AUTHOR: &str = "author"; pub const META_TITLE: &str = "title"; pub const META_DATE: &str = "date"; +pub const META_LANG: &str = "lang"; diff --git a/src/references/configuration/mod.rs b/src/references/configuration/mod.rs index 209ac67..05920ad 100644 --- a/src/references/configuration/mod.rs +++ b/src/references/configuration/mod.rs @@ -1,7 +1,7 @@ use crate::elements::MetadataValue; use crate::references::configuration::config::RootConfig; use crate::references::configuration::keys::{ - BIB_DISPLAY, BIB_HIDE_UNUSED, BIB_REF_DISPLAY, META_AUTHOR, META_DATE, META_TITLE, + BIB_DISPLAY, BIB_HIDE_UNUSED, BIB_REF_DISPLAY, META_AUTHOR, META_DATE, META_LANG, META_TITLE, }; use crate::references::templates::Template; use std::collections::HashMap; @@ -94,6 +94,9 @@ impl Configuration { if let Some(cfg) = &meta.title { self.set(META_TITLE, Value::String(cfg.clone())) } + if let Some(lang) = &meta.language { + self.set(META_LANG, Value::String(lang.clone())) + } } }