fix: 导出PPTX备注错误(#319)

This commit is contained in:
zxc 2025-03-06 20:02:54 +08:00
parent fa2b17bb64
commit 824a38682e

View File

@ -424,7 +424,16 @@ export default () => {
pptxSlide.background = { color: c.color, transparency: (1 - c.alpha) * 100 }
}
}
if (slide.remark) pptxSlide.addNotes(slide.remark)
if (slide.remark) {
const doc = new DOMParser().parseFromString(slide.remark, 'text/html')
const pList = doc.body.querySelectorAll('p')
const text = []
for (const p of pList) {
const textContent = p.textContent
text.push(textContent || '')
}
pptxSlide.addNotes(text.join('\n'))
}
if (!slide.elements) continue