From 8f5696e6b8d77a106c920bc52efda3af09a23228 Mon Sep 17 00:00:00 2001 From: bnewbold Date: Sun, 30 Oct 2016 21:48:52 -0700 Subject: render markdown IMPORTANT: simply un-escaping here, which isn't safe --- src/bin/mt-webface.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/bin') diff --git a/src/bin/mt-webface.rs b/src/bin/mt-webface.rs index a11a038..b5b4fe0 100644 --- a/src/bin/mt-webface.rs +++ b/src/bin/mt-webface.rs @@ -3,6 +3,7 @@ extern crate getopts; extern crate pencil; extern crate modelthing; extern crate env_logger; +extern crate markdown; #[macro_use] extern crate log; @@ -46,6 +47,7 @@ fn model_view(r: &mut Request) -> PencilResult { context.insert("model_name".to_string(), me.metadata.name_en); context.insert("model_description".to_string(), me.metadata.description_en.unwrap_or("".to_string())); //context.insert("metadata".to_string(), me.metadata); + context.insert("markdown_html".to_string(), markdown::to_html(&me.markdown)); context.insert("markdown".to_string(), me.markdown); context.insert("modelica".to_string(), format!("{:?}", me.ast)); r.app.render_template("model_view.html", &context) -- cgit v1.2.3