From: Nutomic Date: Fri, 28 Jul 2023 12:23:46 +0000 (+0200) Subject: Restore markdown quotes after sanitize (#3708) (#3749) X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/%22https:/nerdica.net/%7B?a=commitdiff_plain;h=0e6fb082841b9b6601cce25c5c0a744ac0219b14;p=lemmy.git Restore markdown quotes after sanitize (#3708) (#3749) --- diff --git a/crates/api_common/src/utils.rs b/crates/api_common/src/utils.rs index 8ccb7d3f..5a678191 100644 --- a/crates/api_common/src/utils.rs +++ b/crates/api_common/src/utils.rs @@ -798,10 +798,12 @@ pub fn generate_moderators_url(community_id: &DbUrl) -> Result String { - ammonia::Builder::default() + let sanitized = ammonia::Builder::default() .rm_tags(&["a", "img"]) .clean(data) - .to_string() + .to_string(); + // restore markdown quotes + sanitized.replace(">", ">") } pub fn sanitize_html_opt(data: &Option) -> Option {