mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-03 19:30:04 +08:00
refactor(SvgPreview): add tag use and animate (#9660)
* refactor(SvgPreview): add tag use * refactor(Svg): add tag animate
This commit is contained in:
parent
25c94dc2f0
commit
86635eef49
@ -17,7 +17,8 @@ export function renderSvgInShadowHost(svgContent: string, hostElement: HTMLEleme
|
|||||||
|
|
||||||
// Sanitize the SVG content
|
// Sanitize the SVG content
|
||||||
const sanitizedContent = DOMPurify.sanitize(svgContent, {
|
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' })
|
const shadowRoot = hostElement.shadowRoot || hostElement.attachShadow({ mode: 'open' })
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user