From c59c4c9ee4086d1cee6c95358adf416b62853539 Mon Sep 17 00:00:00 2001 From: Bruno Rocha Date: Tue, 22 Oct 2024 13:13:14 +0100 Subject: [PATCH] misc:tweak markdown render options --- Cargo.toml | 2 +- src/markdown.rs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 687968c..4d7e0ec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "marmite" -version = "0.1.4" +version = "0.1.5" edition = "2021" license = "AGPL-3.0-or-later" description = "MARkdown Makes sITEs is a very simple static site generator, mainly for simple blogs." diff --git a/src/markdown.rs b/src/markdown.rs index c786d8a..e5a5d17 100644 --- a/src/markdown.rs +++ b/src/markdown.rs @@ -12,6 +12,10 @@ pub fn process_file(path: &Path, site_data: &mut Data) -> Result<(), String> { // TODO: Make the following options configurable? options.render.unsafe_ = true; // Allow raw html + options.render.ignore_empty_links = true; + options.render.figure_with_caption = true; + // options.render.escape = false; + // options.render.full_info_string = true; options.extension.tagfilter = false; options.extension.strikethrough = true; // ~~text~~ options.extension.table = true; @@ -24,6 +28,7 @@ pub fn process_file(path: &Path, site_data: &mut Data) -> Result<(), String> { options.extension.spoiler = true; // this is ||secret|| (depends on css) options.extension.greentext = true; // >not a quote options.extension.shortcodes = true; // >not a quote + options.extension.header_ids = Some("tos-".to_string()); // The following 3 options breaks MathJax on themes // options.extension.superscript = true; // 3^2^