Add support for video tag

This commit is contained in:
Francesco Siddi 2017-03-28 16:43:12 +02:00
parent 6001f1936c
commit c846ee9823
2 changed files with 3 additions and 1 deletions

View File

@ -22,6 +22,7 @@ ALLOWED_TAGS = [
'sup', 'sub', 'strike',
'img',
'iframe',
'video',
]
ALLOWED_ATTRIBUTES = {
@ -30,6 +31,7 @@ ALLOWED_ATTRIBUTES = {
'acronym': ['title'],
'img': ['src', 'alt', 'width', 'height', 'title'],
'iframe': ['src', 'width', 'height', 'frameborder', 'allowfullscreen'],
'video': ['autoplay', 'controls', 'loop', 'muted', 'src'],
'*': ['style'],
}

View File

@ -20,7 +20,7 @@
}
// (tags that can be opened/closed) | (tags that stand alone)
var basic_tag_whitelist = /^(<\/?(b|blockquote|code|del|dd|dl|dt|em|h1|h2|h3|i|iframe|kbd|li|ol(?: start="\d+")?|p|pre|s|sup|sub|strong|strike|ul)>|<(br|hr)\s?\/?>)$/i;
var basic_tag_whitelist = /^(<\/?(b|blockquote|code|del|dd|dl|dt|em|h1|h2|h3|i|iframe|kbd|li|ol(?: start="\d+")?|p|pre|s|sup|sub|strong|strike|ul|video)>|<(br|hr)\s?\/?>)$/i;
// <a href="url..." optional title>|</a>
var a_white = /^(<a\shref="((https?|ftp):\/\/|\/)[-A-Za-z0-9+&@#\/%?=~_|!:,.;\(\)*[\]$]+"(\stitle="[^"<>]+")?(\sclass="[^"<>]+")?\s?>|<\/a>)$/i;