refactor(Svg): relax sanitizer rules (#9522)

This commit is contained in:
one 2025-08-25 20:35:32 +08:00 committed by GitHub
parent fd7d2b7580
commit ffa2eb57b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,8 +17,7 @@ export function renderSvgInShadowHost(svgContent: string, hostElement: HTMLEleme
// Sanitize the SVG content
const sanitizedContent = DOMPurify.sanitize(svgContent, {
USE_PROFILES: { svg: true, svgFilters: true },
ADD_TAGS: ['style', 'defs', 'foreignObject']
ADD_TAGS: ['foreignObject']
})
const shadowRoot = hostElement.shadowRoot || hostElement.attachShadow({ mode: 'open' })