mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: nodebb/nodebb-plugin-link-preview#18, remove sup from allowedTags, add source + source attributes
This commit is contained in:
@@ -14,9 +14,8 @@ const utils = require('../utils');
|
|||||||
let sanitizeConfig = {
|
let sanitizeConfig = {
|
||||||
allowedTags: sanitize.defaults.allowedTags.concat([
|
allowedTags: sanitize.defaults.allowedTags.concat([
|
||||||
// Some safe-to-use tags to add
|
// Some safe-to-use tags to add
|
||||||
'sup', 'ins', 'del', 'img', 'button',
|
'ins', 'del', 'img', 'button',
|
||||||
'video', 'audio', 'iframe', 'embed',
|
'video', 'audio', 'source', 'iframe', 'embed',
|
||||||
// 'sup' still necessary until https://github.com/apostrophecms/sanitize-html/pull/422 merged
|
|
||||||
]),
|
]),
|
||||||
allowedAttributes: {
|
allowedAttributes: {
|
||||||
...sanitize.defaults.allowedAttributes,
|
...sanitize.defaults.allowedAttributes,
|
||||||
@@ -25,6 +24,7 @@ let sanitizeConfig = {
|
|||||||
iframe: ['height', 'name', 'src', 'width'],
|
iframe: ['height', 'name', 'src', 'width'],
|
||||||
video: ['autoplay', 'controls', 'height', 'loop', 'muted', 'poster', 'preload', 'src', 'width'],
|
video: ['autoplay', 'controls', 'height', 'loop', 'muted', 'poster', 'preload', 'src', 'width'],
|
||||||
audio: ['autoplay', 'controls', 'loop', 'muted', 'preload', 'src'],
|
audio: ['autoplay', 'controls', 'loop', 'muted', 'preload', 'src'],
|
||||||
|
source: ['type', 'src', 'srcset', 'sizes', 'media', 'height', 'width'],
|
||||||
embed: ['height', 'src', 'type', 'width'],
|
embed: ['height', 'src', 'type', 'width'],
|
||||||
},
|
},
|
||||||
globalAttributes: ['accesskey', 'class', 'contenteditable', 'dir',
|
globalAttributes: ['accesskey', 'class', 'contenteditable', 'dir',
|
||||||
|
|||||||
Reference in New Issue
Block a user