From 291da3a72b0dfdc9fec6845b1c4179143cc0913b Mon Sep 17 00:00:00 2001 From: trivernis Date: Thu, 6 Aug 2020 10:32:46 +0200 Subject: [PATCH] Add MathJax for fancier Math display --- Cargo.lock | 2 +- Cargo.toml | 2 +- README.md | 3 ++- src/format/html.rs | 11 ++++++++++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cbfa2a6..1a4de87 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -592,7 +592,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "snekdown" -version = "0.19.1" +version = "0.19.2" dependencies = [ "asciimath-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "charred 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index 8b90b09..28f8c8c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snekdown" -version = "0.19.1" +version = "0.19.2" authors = ["trivernis "] edition = "2018" license-file = "LICENSE" diff --git a/README.md b/README.md index 281fa76..0fad079 100644 --- a/README.md +++ b/README.md @@ -198,7 +198,8 @@ A = [[1, 2],[3,4]] $$$ ``` -Currently math only get's rendered into MathML which is only supported by Safari and Firefox. +The expression get's converted into MathML which is then converted by MathJax when loaded in +the browser. ## Roadmap diff --git a/src/format/html.rs b/src/format/html.rs index 38595e5..581413a 100644 --- a/src/format/html.rs +++ b/src/format/html.rs @@ -113,7 +113,16 @@ impl ToHtml for Document { if self.is_root { let style = minify(std::include_str!("assets/style.css")); format!( - "\n
{}
", + "\ + \ + \ + + \ + \ + \ +
{}
\ + \ + ", path, style, inner ) } else {