improve(sanitizer): add more allowed attributes (#4194)

* Add a couple of items to the sanitizeOptions

*  Strings must use doublequote  quotes
This commit is contained in:
Helder Sepulveda
2018-02-07 22:51:15 -05:00
committed by kyle
parent 7fd229fe72
commit f2a8ed07e0
2 changed files with 16 additions and 2 deletions

View File

@@ -29,10 +29,12 @@ Markdown.propTypes = {
export default Markdown
const sanitizeOptions = {
allowedTags: sanitize.defaults.allowedTags.concat([ "h1", "h2", "img" ]),
allowedTags: sanitize.defaults.allowedTags.concat([ "h1", "h2", "img", "span" ]),
allowedAttributes: {
...sanitize.defaults.allowedAttributes,
"img": sanitize.defaults.allowedAttributes.img.concat(["title"])
"img": sanitize.defaults.allowedAttributes.img.concat(["title"]),
"td": [ "colspan" ],
"*": [ "class" ]
},
textFilter: function(text) {
return text.replace(/"/g, "\"")