allow target="_blank" for href
This commit is contained in:
parent
009cdd68c3
commit
47fc01742f
1 changed files with 5 additions and 1 deletions
|
@ -55,8 +55,10 @@
|
|||
{
|
||||
'name': 'a',
|
||||
'required': ['href'],
|
||||
'optional': ['target'],
|
||||
'validate': {
|
||||
'href': /^((https?:\/\/|\/|mailto:).*?)/
|
||||
'href': /^((https?:\/\/|\/|mailto:).*?)/,
|
||||
'target': /^_blank$/
|
||||
}
|
||||
},
|
||||
{'name': 'br'},
|
||||
|
@ -507,6 +509,8 @@
|
|||
'<a href="http://www.foo.com/">http://www.foo.com/</a>'
|
||||
> Ox.sanitizeHTML('<a href="http://foo.com" onclick="alert()">foo</a>')
|
||||
'<a href="http://foo.com">foo</a>'
|
||||
> Ox.sanitizeHTML('<a href="http://foo.com" target="_blank">foo</a>')
|
||||
'<a href="http://foo.com" target="_blank">foo</a>'
|
||||
> Ox.sanitizeHTML('<a href="javascript:alert()">foo</a>')
|
||||
'<a href="javascript:alert()">foo</a>'
|
||||
> Ox.sanitizeHTML('<a href="foo">foo</a>')
|
||||
|
|
Loading…
Reference in a new issue