Transform h1 and h2 tags to h3 tags

Addresses vector-im/riot-web#1772

Signed-off-by: Travis Ralston <travpc@gmail.com>
pull/21833/head
turt2live 2017-04-21 15:09:56 -06:00
parent ae8d04b35d
commit 80b8be64d1
1 changed files with 6 additions and 0 deletions

View File

@ -165,6 +165,12 @@ var sanitizeHtmlParams = {
attribs.rel = 'noopener'; // https://mathiasbynens.github.io/rel-noopener/
return { tagName: tagName, attribs : attribs };
},
'h1': function(tagName, attribs) {
return { tagName: 'h3', attribs: attribs };
},
'h2': function(tagName, attribs) {
return { tagName: 'h3', attribs: attribs };
},
'*': function(tagName, attribs) {
// Delete any style previously assigned, style is an allowedTag for font and span
// because attributes are stripped after transforming