Skip to content

Commit

Permalink
Transform h1 and h2 tags to h3 tags
Browse files Browse the repository at this point in the history
Addresses element-hq/element-web#1772

Signed-off-by: Travis Ralston <travpc@gmail.com>
  • Loading branch information
turt2live committed Apr 21, 2017
1 parent ae8d04b commit 80b8be6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/HtmlUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 80b8be6

Please sign in to comment.