Skip to content

Commit

Permalink
Fix markdown images
Browse files Browse the repository at this point in the history
  • Loading branch information
Geometrically committed Sep 25, 2024
1 parent 3b8963f commit 8e052ad
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/utils/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 8e052ad

Please sign in to comment.