Browse Source

Escape HTML comment tags so that HTML comments are visible.

Thanks to xet7 !
Lauri Ojansivu 2 years ago
parent
commit
167863d957
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/markdown/src/template-integration.js

+ 1 - 1
packages/markdown/src/template-integration.js

@@ -65,6 +65,6 @@ if (Package.ui) {
       text = Blaze._toText(self.templateContentBlock, HTML.TEXTMODE.STRING);
       text = Blaze._toText(self.templateContentBlock, HTML.TEXTMODE.STRING);
     }
     }
 
 
-    return HTML.Raw(DOMPurify.sanitize(Markdown.render(text), {ALLOW_UNKNOWN_PROTOCOLS: true}));
+    return HTML.Raw(DOMPurify.sanitize(Markdown.render(text).replace('<!--', '&lt;!--').replace('-->', '--&gt;'), {ALLOW_UNKNOWN_PROTOCOLS: true}));
   }));
   }));
 }
 }