Found and fixed more InvisibleBleed of WeKan.

Thanks to xet7 !
This commit is contained in:
Lauri Ojansivu 2023-06-09 20:08:25 +03:00
parent 46c29a0b97
commit 4c016169c5

View file

@ -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('<!--', '&lt;!--').replace('-->', '--&gt;'), {ALLOW_UNKNOWN_PROTOCOLS: true}));
if (text.includes("[]") !== false || text.includes("<!--") !== false || text.includes("-->") !== false) {
return HTML.Raw('<h2 style="color: red; background-color: yellow;">WARNING! HIDDEN TEXT!</h2><pre style="background-color: red;">' + DOMPurify.sanitize(text.replace('<!--', '&lt;!--').replace('-->', '--&gt;').replace('<pre>', '').replace('</pre>','') + '</pre>'));
} else {
return HTML.Raw(DOMPurify.sanitize(Markdown.render(text).replace('<!--', '&lt;!--').replace('-->', '--&gt;'), {ALLOW_UNKNOWN_PROTOCOLS: true}));
}
}));
}