Fix:修复导出时样式不全导致的公式格式错误的bug

This commit is contained in:
wangshun 2024-08-30 12:40:00 +08:00
parent bd0af7ac02
commit 49e3a80113

View File

@ -93,7 +93,15 @@ class Export {
if (this.mindMap.richText) {
const foreignObjectList = svg.find('foreignObject')
if (foreignObjectList.length > 0) {
foreignObjectList[0].add(SVG(`<style>${resetCss}</style>`))
foreignObjectList[0].add(
SVG(`<style>${resetCss}</style>`),
SVG(
'<style>.katex-html[aria-hidden=true]{display:none !important;}</style>'
)
)
for (const v of document.getElementsByTagName('style')) {
foreignObjectList[0].add(SVG(v.outerHTML))
}
svgIsChange = true
}
// 如果还开启了数学公式还要插入katex库的样式