diff --git a/browser/lib/markdown.js b/browser/lib/markdown.js index b16838f6f..7a2a7a8ae 100644 --- a/browser/lib/markdown.js +++ b/browser/lib/markdown.js @@ -55,9 +55,37 @@ class Markdown { // Sanitize use rinput before other plugins this.md.use(sanitize, { - allowedTags: ['img', 'iframe', 'input', 'details', 'summary', 'table', 'th', 'tr', 'td', 'thead', 'tfoot', 'tbody'], + allowedTags: ['iframe', 'input', + 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'h7', 'h8', 'br', 'b', 'i', 'strong', 'em', 'a', 'pre', 'code', 'img', 'tt', + 'div', 'ins', 'del', 'sup', 'sub', 'p', 'ol', 'ul', 'table', 'thead', 'tbody', 'tfoot', 'blockquote', + 'dl', 'dt', 'dd', 'kbd', 'q', 'samp', 'var', 'hr', 'ruby', 'rt', 'rp', 'li', 'tr', 'td', 'th', 's', 'strike', 'summary', 'details' + ], allowedAttributes: { - '*': ['alt', 'style'], + '*': [ + 'abbr', 'accept', 'accept-charset', + 'accesskey', 'action', 'align', 'alt', 'axis', + 'border', 'cellpadding', 'cellspacing', 'char', + 'charoff', 'charset', 'checked', + 'clear', 'cols', 'colspan', 'color', + 'compact', 'coords', 'datetime', 'dir', + 'disabled', 'enctype', 'for', 'frame', + 'headers', 'height', 'hreflang', + 'hspace', 'ismap', 'label', 'lang', + 'maxlength', 'media', 'method', + 'multiple', 'name', 'nohref', 'noshade', + 'nowrap', 'open', 'prompt', 'readonly', 'rel', 'rev', + 'rows', 'rowspan', 'rules', 'scope', + 'selected', 'shape', 'size', 'span', + 'start', 'summary', 'tabindex', 'target', + 'title', 'type', 'usemap', 'valign', 'value', + 'vspace', 'width', 'itemprop' + ], + 'a': ['href'], + 'div': ['itemscope', 'itemtype'], + 'blockquote': ['cite'], + 'del': ['cite'], + 'ins': ['cite'], + 'q': ['cite'], 'img': ['src', 'width', 'height'], 'iframe': ['src', 'width', 'height', 'frameborder', 'allowfullscreen'], 'input': ['type', 'id', 'checked']