import DOMPurify from 'dompurify'; import { getSecureDOMPurifyConfig } from './secureDOMPurify'; var Markdown = require('markdown-it')({ html: true, linkify: true, typographer: true, breaks: true, }); //import markdownItMermaid from "@wekanteam/markdown-it-mermaid"; // Static URL Scheme Listing var urlschemes = [ "aodroplink", "thunderlink", "cbthunderlink", "onenote", "file", "abasurl", "conisio", "mailspring" ]; // Better would be a field in the admin backend to set this dynamically // instead of putting all known or wanted url schemes here hard into code // but i was not able to access those settings // var urlschemes = currentSetting.automaticLinkedUrlSchemes.split('\n'); // put all url schemes into the linkify configuration to automatically make it clickable for(var i=0; i'); // Check for malicious img tags with SVG data URIs const hasMaliciousImg = content.includes('' + DOMPurify.sanitize(text.replace('', '-->'), getSecureDOMPurifyConfig()) + ''); } else { // Prevent hiding info: https://wekan.github.io/hall-of-fame/invisiblebleed/ // If text does not have hidden markdown link, render all markdown. // Also show html comments. const renderedMarkdown = Markdown.render(text).replace('', '-->'); const sanitized = DOMPurify.sanitize(renderedMarkdown, getSecureDOMPurifyConfig()); return HTML.Raw(sanitized); } })); }