fix(shtola): parse raw html in markdown (0.4.2)

master
ana 11 months ago
parent 4af45ae6f2
commit 4a21aa6045
  1. 10
      Cargo.lock
  2. 6
      shtola/CHANGELOG.md
  3. 2
      shtola/Cargo.toml
  4. 4
      shtola/src/plugins/markdown.rs

10
Cargo.lock generated

@ -428,7 +428,7 @@ version = "0.5.5"
dependencies = [
"argh",
"minifemme",
"shtola 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"shtola 0.4.1",
]
[[package]]
@ -812,12 +812,13 @@ checksum = "b6fa3938c99da4914afedd13bf3d79bcb6c277d1b2c398d23257a304d9e1b074"
[[package]]
name = "shtola"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e941af3f1233c7fe2685cd88b858444565c9c2685ee3cc88ac67fc3ab9d447f"
dependencies = [
"comrak",
"globset",
"id_tree",
"log",
"minifemme",
"pathdiff",
"serde_json",
"serde_yaml",
@ -828,14 +829,13 @@ dependencies = [
[[package]]
name = "shtola"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e941af3f1233c7fe2685cd88b858444565c9c2685ee3cc88ac67fc3ab9d447f"
version = "0.4.2"
dependencies = [
"comrak",
"globset",
"id_tree",
"log",
"minifemme",
"pathdiff",
"serde_json",
"serde_yaml",

@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.4.2] - 2021-11-10
### Changed
- Enabled the Markdown processor to accept raw HTML.
## [0.4.1] - 2021-11-10
### Fixed

@ -1,7 +1,7 @@
[package]
name = "shtola"
description = "Minimal static site generator"
version = "0.4.1"
version = "0.4.2"
authors = ["anastasie <mokou@fastmail.com>"]
edition = "2018"
repository = "https://git.mokou.org/mokou/shtola"

@ -5,6 +5,8 @@ use comrak::{markdown_to_html, ComrakOptions};
pub fn plugin() -> Plugin {
Box::new(|mut ir: RefIR| {
info!("Starting Markdown processing");
let mut markdown_options = ComrakOptions::default();
markdown_options.render.unsafe_ = true;
let files = ir.files.clone();
let markdown_files = files.iter().filter(|(p, _)| match p.extension() {
Some(ext) => ext == "md",
@ -20,7 +22,7 @@ pub fn plugin() -> Plugin {
ShFile {
content: markdown_to_html(
std::str::from_utf8(&file.content).unwrap(),
&ComrakOptions::default(),
&markdown_options,
)
.into(),
frontmatter: file.frontmatter.clone(),

Loading…
Cancel
Save