From 4c0d4c560cae8b4fefd64277a1ad24b4d591e255 Mon Sep 17 00:00:00 2001 From: trivernis Date: Sat, 23 Jan 2021 15:44:49 +0100 Subject: [PATCH] Fix mathjax include Signed-off-by: trivernis --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/format/html/to_html.rs | 13 +++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4e4e7db..27b82f7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2315,7 +2315,7 @@ checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" [[package]] name = "snekdown" -version = "0.33.0" +version = "0.33.1" dependencies = [ "asciimath-rs", "base64 0.12.3", diff --git a/Cargo.toml b/Cargo.toml index 8bd57fb..2621552 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snekdown" -version = "0.33.0" +version = "0.33.1" authors = ["trivernis "] edition = "2018" license-file = "LICENSE" diff --git a/src/format/html/to_html.rs b/src/format/html/to_html.rs index 88489fd..0ec6dbb 100644 --- a/src/format/html/to_html.rs +++ b/src/format/html/to_html.rs @@ -154,16 +154,17 @@ impl ToHtml for Document { writer.write(style)?; writer.write("".to_string())?; + if self.config.lock().features.include_mathjax { + writer.write(format!( + "", + MATHJAX_URL + ))?; + } + for stylesheet in &self.stylesheets { let mut stylesheet = stylesheet.lock(); let data = std::mem::replace(&mut stylesheet.data, None); if let Some(data) = data { - if self.config.lock().features.include_mathjax { - writer.write(format!( - "", - MATHJAX_URL - ))?; - } writer.write("".to_string())?;