Skip to content

Commit

Permalink
Allow srcset
Browse files Browse the repository at this point in the history
  • Loading branch information
zadeviggers authored Jan 25, 2022
1 parent be9c90d commit 5fccedb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -780,10 +780,9 @@ sanitizeHtml.defaults = {
disallowedTagsMode: 'discard',
allowedAttributes: {
a: [ 'href', 'name', 'target' ],
// We don't currently allow img itself by default, but these
// would make sense if we did. You could add srcset here,
// and if you do the URL is checked for safety
img: [ 'src', 'alt', 'title', 'width', 'height', 'loading' ]
// We don't currently allow img itself by default, but
// these attributes would make sense if we did.
img: [ 'src', 'srcset', 'alt', 'title', 'width', 'height', 'loading' ]
},
// Lots of these won't come up by default because we don't allow them
selfClosing: [ 'img', 'br', 'hr', 'area', 'base', 'basefont', 'input', 'link', 'meta' ],
Expand Down

0 comments on commit 5fccedb

Please sign in to comment.