From 4c016169c55e0dc5df9533795ddfec424a053300 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Fri, 9 Jun 2023 20:08:25 +0300 Subject: [PATCH] Found and fixed more InvisibleBleed of WeKan. Thanks to xet7 ! --- packages/markdown/src/template-integration.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/markdown/src/template-integration.js b/packages/markdown/src/template-integration.js index f697d177e..095006426 100644 --- a/packages/markdown/src/template-integration.js +++ b/packages/markdown/src/template-integration.js @@ -64,7 +64,10 @@ if (Package.ui) { if (self.templateContentBlock) { text = Blaze._toText(self.templateContentBlock, HTML.TEXTMODE.STRING); } - - return HTML.Raw(DOMPurify.sanitize(Markdown.render(text).replace('', '-->'), {ALLOW_UNKNOWN_PROTOCOLS: true})); + if (text.includes("[]") !== false || text.includes("") !== false) { + return HTML.Raw('

WARNING! HIDDEN TEXT!

' + DOMPurify.sanitize(text.replace('', '-->').replace('
', '').replace('
','') + '
')); + } else { + return HTML.Raw(DOMPurify.sanitize(Markdown.render(text).replace('', '-->'), {ALLOW_UNKNOWN_PROTOCOLS: true})); + } })); }