Skip to content

Commit

Permalink
Add common image attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
zadeviggers authored Jan 24, 2022
1 parent 379b55b commit be9c90d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -780,10 +780,10 @@ sanitizeHtml.defaults = {
disallowedTagsMode: 'discard',
allowedAttributes: {
a: [ 'href', 'name', 'target' ],
// We don't currently allow img itself by default, but this
// 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' ]
img: [ 'src', '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 be9c90d

Please sign in to comment.