diff --git a/Cargo.lock b/Cargo.lock index 4ea0eb37d..b2c9fc07d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -60,7 +60,7 @@ name = "blog" version = "0.1.0" dependencies = [ "chrono 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)", - "comrak 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "comrak 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "fs_extra 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "handlebars 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -118,7 +118,7 @@ dependencies = [ [[package]] name = "comrak" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -568,7 +568,7 @@ dependencies = [ "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" "checksum chrono 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)" = "c74d84029116787153e02106bf53e66828452a4b325cc8652b788b5967c0a0b6" "checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" -"checksum comrak 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e17058cc536cf290563e88787d7b9e6030ce4742943017cc2ffb71f88034021c" +"checksum comrak 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b818732a109eeabbe99fee28030ff8ecbd606889fcd25509ed933e6c69b7aa69" "checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" "checksum dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "4358a9e11b9a09cf52383b451b49a169e8d797b68aa02301ff586d70d9661ea3" "checksum entities 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b5320ae4c3782150d900b79807611a59a99fc9a1d61d686faafc24b93fc8d7ca" diff --git a/Cargo.toml b/Cargo.toml index 736dd401b..7c01e45fc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ serde = "1.0" serde_derive = "1.0" serde_yaml = "0.8" serde_json = "1.0" -comrak = "0.7" +comrak = "0.8" fs_extra = "1.1.0" regex = "1.3" sass-rs = "0.2.1" diff --git a/src/main.rs b/src/main.rs index c0d271aff..51f89292b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,9 +1,9 @@ mod blogs; mod posts; -use chrono::Timelike; use crate::blogs::Blog; use crate::posts::Post; +use chrono::Timelike; use handlebars::{handlebars_helper, Handlebars}; use sass_rs::{compile_file, Options}; use serde_derive::Serialize; diff --git a/src/posts.rs b/src/posts.rs index e38982f2c..d8770f5ab 100644 --- a/src/posts.rs +++ b/src/posts.rs @@ -1,5 +1,5 @@ use crate::blogs::Manifest; -use comrak::ComrakOptions; +use comrak::{ComrakExtensionOptions, ComrakOptions, ComrakRenderOptions}; use regex::Regex; use serde_derive::{Deserialize, Serialize}; use std::error::Error; @@ -64,8 +64,14 @@ impl Post { } = serde_yaml::from_str(yaml)?; // next, the contents. we add + to get rid of the final "---\n\n" let options = ComrakOptions { - ext_header_ids: Some(String::new()), - unsafe_: true, // Allow rendering of raw HTML + render: ComrakRenderOptions { + unsafe_: true, // Allow rendering of raw HTML + ..ComrakRenderOptions::default() + }, + extension: ComrakExtensionOptions { + header_ids: Some(String::new()), + ..ComrakExtensionOptions::default() + }, ..ComrakOptions::default() };