mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-05 12:29:44 +08:00
refactor(Svg): relax sanitizer rules (#9522)
This commit is contained in:
parent
fd7d2b7580
commit
ffa2eb57b1
@ -17,8 +17,7 @@ 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, {
|
||||||
USE_PROFILES: { svg: true, svgFilters: true },
|
ADD_TAGS: ['foreignObject']
|
||||||
ADD_TAGS: ['style', 'defs', 'foreignObject']
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const shadowRoot = hostElement.shadowRoot || hostElement.attachShadow({ mode: 'open' })
|
const shadowRoot = hostElement.shadowRoot || hostElement.attachShadow({ mode: 'open' })
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user