From cccd44c00c98384e8aa92a55ac43c512c6f716d1 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 20 Feb 2023 09:31:06 +0800 Subject: [PATCH] :bug: https://github.com/siyuan-note/siyuan/issues/5213 --- app/src/asset/anno.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/asset/anno.ts b/app/src/asset/anno.ts index d53deb72b..f5817fa7f 100644 --- a/app/src/asset/anno.ts +++ b/app/src/asset/anno.ts @@ -314,7 +314,7 @@ const getHightlightCoordsByRange = (pdf: any, color: string) => { // https://github.com/siyuan-note/siyuan/issues/5213 const rangeContents = range.cloneContents(); Array.from(rangeContents.children).forEach(item => { - if (item.tagName === "BR") { + if (item.tagName === "BR" && item.previousElementSibling && item.nextElementSibling) { const previousText = item.previousElementSibling.textContent; const nextText = item.nextElementSibling.textContent; if (previousText.endsWith("-") && /^[A-Za-z]$/.test(previousText.substring(previousText.length - 2, previousText.length - 1)) &&