aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2016-10-30 21:48:52 -0700
committerbnewbold <bnewbold@robocracy.org>2016-10-30 21:48:55 -0700
commit8f5696e6b8d77a106c920bc52efda3af09a23228 (patch)
tree6756f1b4b427254a768d60c8213a7ec44575ee17 /src
parent440c700657b70ae54a958c20f3a19c417712ceab (diff)
downloadmodelthing-8f5696e6b8d77a106c920bc52efda3af09a23228.tar.gz
modelthing-8f5696e6b8d77a106c920bc52efda3af09a23228.zip
render markdown
IMPORTANT: simply un-escaping here, which isn't safe
Diffstat (limited to 'src')
-rw-r--r--src/bin/mt-webface.rs2
1 files changed, 2 insertions, 0 deletions
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)