Skip to content

Commit

Permalink
Use same settings of github
Browse files Browse the repository at this point in the history
  • Loading branch information
Rokt33r committed Mar 13, 2018
1 parent cb823ea commit 0816a94
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions browser/lib/markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down

0 comments on commit 0816a94

Please sign in to comment.