Explorar el Código

Found and fixed more InvisibleBleed of WeKan.

Thanks to xet7 !
Lauri Ojansivu hace 2 años
padre
commit
4c016169c5
Se han modificado 1 ficheros con 5 adiciones y 2 borrados
  1. 5 2
      packages/markdown/src/template-integration.js

+ 5 - 2
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('<!--', '&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}));
+    }
   }));
 }