fix: error when invalid iframe in markdown (#5985)

This commit is contained in:
Prospector
2026-05-04 02:47:15 -07:00
committed by GitHub
parent 7d6f77bebf
commit 565ac2cb53

View File

@@ -49,6 +49,7 @@ export const configuredXss = new FilterXSS({
},
]
try {
const url = new URL(value)
for (const source of allowedSources) {
@@ -66,6 +67,7 @@ export const configuredXss = new FilterXSS({
url.search = newSearchParams.toString()
return `${name}="${escapeAttrValue(url.toString())}"`
}
} catch {}
}
// For Highlight.JS