fix: relaxing strict allowedTags configuration for incoming AP content (allowing picture, source, and additional attributes for img)

re: #13185
This commit is contained in:
Julian Lam
2025-02-20 14:07:39 -05:00
parent f84b9fc75b
commit 2ad48f1714

View File

@@ -29,12 +29,14 @@ const Mocks = module.exports;
* Done so the output HTML is stripped of all non-essential items; mainly classes from plugins.. * Done so the output HTML is stripped of all non-essential items; mainly classes from plugins..
*/ */
const sanitizeConfig = { const sanitizeConfig = {
allowedTags: sanitize.defaults.allowedTags.concat(['img']), allowedTags: sanitize.defaults.allowedTags.concat(['img', 'picture', 'source']),
allowedClasses: { allowedClasses: {
'*': [], '*': [],
}, },
allowedAttributes: { allowedAttributes: {
a: ['href', 'rel'], a: ['href', 'rel'],
source: ['type', 'src', 'srcset', 'sizes', 'media', 'height', 'width'],
img: ['alt', 'height', 'ismap', 'src', 'usemap', 'width', 'srcset'],
}, },
}; };