about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/micropub/util.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/micropub/util.rs b/src/micropub/util.rs
index 9bbdcf6..19f4953 100644
--- a/src/micropub/util.rs
+++ b/src/micropub/util.rs
@@ -94,7 +94,17 @@ pub fn normalize_mf2(mut body: serde_json::Value, user: &TokenData) -> (String,
     if body["properties"]["content"][0].is_string() {
         // Convert the content to HTML using the `markdown` crate
         body["properties"]["content"] = json!([{
-            "html": markdown::to_html(body["properties"]["content"][0].as_str().unwrap()),
+            "html": markdown::to_html_with_options(
+                body["properties"]["content"][0].as_str().unwrap(),
+                &markdown::Options {
+                    compile: markdown::CompileOptions {
+                        allow_dangerous_html: true,
+                        allow_dangerous_protocol: false,
+                        ..Default::default()
+                    },
+                    parse: markdown::ParseOptions::default()
+                }
+            ).unwrap(),
             "value": body["properties"]["content"][0]
         }])
     }