Fix markdown images (#2452)

This commit is contained in:
Geometrically 2024-09-25 12:29:51 -07:00 committed by GitHub
parent 3b8963fad0
commit 2713f0e610
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -77,7 +77,11 @@ export const configuredXss = new FilterXSS({
}
},
safeAttrValue(tag, name, value, cssFilter) {
if (tag === 'img' && name === 'src' && !value.startsWith('data:')) {
if (
(tag === 'img' || tag === 'video' || tag === 'audio' || tag === 'source') &&
(name === 'src' || name === 'srcset') &&
!value.startsWith('data:')
) {
try {
const url = new URL(value)