mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-06-28 06:46:12 +00:00
@@ -101,8 +101,8 @@ const initMermaid = (mermaidElements: Element[]) => {
|
||||
let svg = mermaidData.svg.replace(/(href|src|xlink:href)\s*=\s*["']\\\\/gi, (match, p1) => `${p1}="about:blank"`);
|
||||
svg = window.DOMPurify.sanitize(svg, {
|
||||
USE_PROFILES: { svg: true, svgFilters: true },
|
||||
ADD_TAGS: ['foreignObject', 'use', 'style'],
|
||||
ADD_ATTR: ['dominant-baseline', 'xlink:href', 'href'], // 保留对齐和链接属性
|
||||
ADD_TAGS: ["foreignObject", "use", "style"],
|
||||
ADD_ATTR: ["dominant-baseline", "xlink:href", "href"], // 保留对齐和链接属性
|
||||
// 必须添加此项,否则 foreignObject 里的 HTML 内容会被清空
|
||||
HTML_INTEGRATION_POINTS: { foreignobject: true }
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user