import DOMPurify from 'dompurify'; 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' + DOMPurify.sanitize(text.replace('', '-->')) + ''); } 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. return HTML.Raw(DOMPurify.sanitize(Markdown.render(text).replace('', '-->'), {ALLOW_UNKNOWN_PROTOCOLS: true})); } })); }