fix: 导出PPTX文件缺少文本框行内超链接

This commit is contained in:
pipipi-pikachu 2022-04-10 14:07:04 +08:00
parent 966cd156eb
commit 96c38e1e54

View File

@ -112,6 +112,10 @@ export default () => {
if (item.tagName === 'sub') {
styleObj['vertical-align'] = 'sub'
}
if (item.tagName === 'a') {
const attr = item.attributes.find(attr => attr.key === 'href')
styleObj['href'] = attr?.value || ''
}
}
if ('tagName' in item && item.tagName === 'br') {
@ -160,6 +164,7 @@ export default () => {
if (styleObj['font-weight']) options.bold = styleObj['font-weight'] === 'bold'
if (styleObj['font-style']) options.italic = styleObj['font-style'] === 'italic'
if (styleObj['font-family']) options.fontFace = styleObj['font-family']
if (styleObj['href']) options.hyperlink = { url: styleObj['href'] }
slices.push({ text, options })
}