fix: error when invalid iframe in markdown (#5985)
This commit is contained in:
@@ -49,6 +49,7 @@ export const configuredXss = new FilterXSS({
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
try {
|
||||||
const url = new URL(value)
|
const url = new URL(value)
|
||||||
|
|
||||||
for (const source of allowedSources) {
|
for (const source of allowedSources) {
|
||||||
@@ -66,6 +67,7 @@ export const configuredXss = new FilterXSS({
|
|||||||
url.search = newSearchParams.toString()
|
url.search = newSearchParams.toString()
|
||||||
return `${name}="${escapeAttrValue(url.toString())}"`
|
return `${name}="${escapeAttrValue(url.toString())}"`
|
||||||
}
|
}
|
||||||
|
} catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
// For Highlight.JS
|
// For Highlight.JS
|
||||||
|
|||||||
Reference in New Issue
Block a user