From e6d47c730ad9460c84e7feeb3e1ba739b39f1c76 Mon Sep 17 00:00:00 2001 From: purocean Date: Fri, 29 Oct 2021 13:56:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=A4=A7=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E9=94=9A=E7=82=B9=E8=B7=B3=E8=BD=AC=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E4=BD=8D=E7=BD=AE=E4=B8=8D=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/plugins/markdown-link.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/renderer/plugins/markdown-link.ts b/src/renderer/plugins/markdown-link.ts index d574c244..67cc4a30 100644 --- a/src/renderer/plugins/markdown-link.ts +++ b/src/renderer/plugins/markdown-link.ts @@ -55,6 +55,7 @@ const handleLink = (link: HTMLAnchorElement) => { document.getElementById(encodeURIComponent(hash.replace(/^h-/, ''))) if (el) { + await sleep(0) el.scrollIntoView() // 如果是标题的话,也顺便将编辑器滚动到可视区域