refactor(SvgPreview): add tag use and animate (#9660)

* refactor(SvgPreview): add tag use

* refactor(Svg): add tag animate
This commit is contained in:
one 2025-08-29 18:29:52 +08:00 committed by GitHub
parent 25c94dc2f0
commit 86635eef49
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,7 +17,8 @@ export function renderSvgInShadowHost(svgContent: string, hostElement: HTMLEleme
// Sanitize the SVG content
const sanitizedContent = DOMPurify.sanitize(svgContent, {
ADD_TAGS: ['foreignObject']
ADD_TAGS: ['animate', 'foreignObject', 'use'],
ADD_ATTR: ['from', 'to']
})
const shadowRoot = hostElement.shadowRoot || hostElement.attachShadow({ mode: 'open' })