From f375b244d72d4c8f8f27f1e62b7bcaa6de174dec Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 23 Jun 2022 01:30:53 +0800 Subject: [PATCH] :adhesive_bandage: https://github.com/siyuan-note/siyuan/issues/5213 --- app/src/asset/anno.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/asset/anno.ts b/app/src/asset/anno.ts index a2e3d3188..8c0fc4219 100644 --- a/app/src/asset/anno.ts +++ b/app/src/asset/anno.ts @@ -388,7 +388,9 @@ const getHightlightCoordsByRange = (pdf: any, color: string) => { Array.from(rangeContents.children).forEach(item => { if (item.tagName === "BR") { const previousText = item.previousElementSibling.textContent; - if (previousText.endsWith("-")) { + const nextText = item.nextElementSibling.textContent; + if (previousText.endsWith("-") && /^[A-Za-z]$/.test(previousText.substring(previousText.length - 2, previousText.length - 1)) && + /^[A-Za-z]$/.test(nextText.substring(0, 1))) { item.previousElementSibling.textContent = previousText.substring(0, previousText.length - 1); } else { item.insertAdjacentText("afterend", " ");