From 96c38e1e54ec5466d03abf5e1cbcd114948bb3a1 Mon Sep 17 00:00:00 2001 From: pipipi-pikachu Date: Sun, 10 Apr 2022 14:07:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AF=BC=E5=87=BAPPTX=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=BC=BA=E5=B0=91=E6=96=87=E6=9C=AC=E6=A1=86=E8=A1=8C=E5=86=85?= =?UTF-8?q?=E8=B6=85=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useExport.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hooks/useExport.ts b/src/hooks/useExport.ts index 22457f53..499c8c8e 100644 --- a/src/hooks/useExport.ts +++ b/src/hooks/useExport.ts @@ -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 }) }