From c7865691710b4f6c3d205b0b1acb877742b49f5d Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Fri, 7 Jan 2022 05:36:39 +0900 Subject: [PATCH] Define plume_common::escape() --- plume-common/src/utils.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plume-common/src/utils.rs b/plume-common/src/utils.rs index 4bb23c85..4f55a53a 100644 --- a/plume-common/src/utils.rs +++ b/plume-common/src/utils.rs @@ -466,6 +466,10 @@ pub fn md_to_html<'a>( (buf, mentions.collect(), hashtags.collect()) } +pub fn escape(string: &str) -> askama_escape::Escaped { + askama_escape::escape(string, askama_escape::Html) +} + #[cfg(test)] mod tests { use super::*;