html: allow class, title and style attributes
This commit is contained in:
parent
c1924f8e41
commit
225590ecb2
1 changed files with 9 additions and 2 deletions
|
|
@ -5,7 +5,11 @@ var Widget = require('../common/widget'),
|
|||
StaticProperties = require('../mixins/static_properties')
|
||||
|
||||
var sanitizeOptions = {
|
||||
allowedTags: sanitizeHtml.defaults.allowedTags.concat(['img', 'h1', 'h2']).filter(x=>x!=='iframe')
|
||||
allowedTags: sanitizeHtml.defaults.allowedTags.concat(['img', 'h1', 'h2']).filter(x=>x!=='iframe'),
|
||||
allowedAttributes: {
|
||||
'*': [ 'title', 'class', 'style'],
|
||||
'img': [ 'src' , 'title', 'class', 'style', 'width', 'height']
|
||||
}
|
||||
}
|
||||
|
||||
class Html extends StaticProperties(Widget, {bypass: true}) {
|
||||
|
|
@ -27,7 +31,10 @@ class Html extends StaticProperties(Widget, {bypass: true}) {
|
|||
'Allowed HTML tags:',
|
||||
' h1-6, blockquote, p, a, ul, ol, nl, li,',
|
||||
' b, i, strong, em, strike, code, hr, br, div,',
|
||||
' table, thead, img, caption, tbody, tr, th, td, pre'
|
||||
' table, thead, img, caption, tbody, tr, th, td, pre',
|
||||
'Allowed attributes:',
|
||||
' <*>: class, style, title',
|
||||
' <img>: src, width, height',
|
||||
]},
|
||||
|
||||
}, ['decimals', 'bypass'], {})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue