update(fix): security issues (#25 & #26)

This commit is contained in:
rooyca 2024-06-16 18:06:31 -05:00
parent 50e0c29932
commit 64d587deba

View file

@ -2,9 +2,6 @@
export class MarkdownParser {
parse(text) {
// Remove all <script> tags
text = text.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '');
// Headers
text = text.replace(/^(#{1,6})\s*(.*)$/gm, (match, p1, p2) => `<h${p1.length}>${p2}</h${p1.length}>`);