Commit 6d51f8ad authored by Christopher Davis's avatar Christopher Davis Committed by Daniel Garcia Moreno

Revert "Don't send markdown in the body when parsed"

This reverts commit 7bfe63ac.
parent 24cd341b
Pipeline #10101 passed with stage
in 24 minutes and 56 seconds
......@@ -388,7 +388,6 @@ dependencies = [
name = "fractal-gtk"
version = "0.1.27"
dependencies = [
"ammonia 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cairo-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"chrono 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"comrak 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)",
......
......@@ -5,7 +5,6 @@ extern crate gdk;
extern crate notify_rust;
extern crate rand;
extern crate comrak;
extern crate ammonia;
use std::env;
......@@ -18,7 +17,7 @@ use self::chrono::prelude::*;
use self::rand::{thread_rng, Rng};
use self::comrak::{markdown_to_html, ComrakOptions};
use self::comrak::{markdown_to_html,ComrakOptions};
use std::sync::{Arc, Mutex};
use std::sync::mpsc::channel;
......@@ -1383,14 +1382,6 @@ impl AppOp {
let md_parsed_msg = markdown_to_html(&msg, &ComrakOptions::default());
if md_parsed_msg != String::from("<p>") + &msg + &String::from("</p>\n") {
// removing all markdown from the text body
let sanitized_html = ammonia::Builder::new()
.tags([].iter().cloned().collect())
.tag_attributes([].iter().cloned().collect())
.link_rel(None)
.clean(&md_parsed_msg)
.to_string();
m.body = sanitized_html;
m.formatted_body = Some(md_parsed_msg);
m.format = Some(String::from("org.matrix.custom.html"));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment