From 86635eef499c4e5edd5dfc31d107c34eff07d57b Mon Sep 17 00:00:00 2001 From: one Date: Fri, 29 Aug 2025 18:29:52 +0800 Subject: [PATCH] refactor(SvgPreview): add tag use and animate (#9660) * refactor(SvgPreview): add tag use * refactor(Svg): add tag animate --- src/renderer/src/components/Preview/utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/components/Preview/utils.ts b/src/renderer/src/components/Preview/utils.ts index 3a8119f166..42b93df156 100644 --- a/src/renderer/src/components/Preview/utils.ts +++ b/src/renderer/src/components/Preview/utils.ts @@ -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' })