mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-17 09:30:48 +08:00
This commit is contained in:
parent
4201f3de97
commit
7f2d191c67
@ -320,13 +320,16 @@ const getHightlightCoordsByRange = (pdf: any, color: string) => {
|
|||||||
if (item.tagName === "BR" && item.previousElementSibling && item.nextElementSibling) {
|
if (item.tagName === "BR" && item.previousElementSibling && item.nextElementSibling) {
|
||||||
const previousText = item.previousElementSibling.textContent;
|
const previousText = item.previousElementSibling.textContent;
|
||||||
const nextText = item.nextElementSibling.textContent;
|
const nextText = item.nextElementSibling.textContent;
|
||||||
if (previousText.endsWith("-") && /^[A-Za-z]$/.test(previousText.substring(previousText.length - 2, previousText.length - 1)) &&
|
if (/^[A-Za-z]$/.test(previousText.substring(previousText.length - 2, previousText.length - 1)) &&
|
||||||
/^[A-Za-z]$/.test(nextText.substring(0, 1))) {
|
/^[A-Za-z]$/.test(nextText.substring(0, 1))) {
|
||||||
|
if (previousText.endsWith("-")) {
|
||||||
item.previousElementSibling.textContent = previousText.substring(0, previousText.length - 1);
|
item.previousElementSibling.textContent = previousText.substring(0, previousText.length - 1);
|
||||||
} else {
|
} else {
|
||||||
|
// 中文情况不能添加 https://github.com/siyuan-note/siyuan/issues/8152
|
||||||
item.insertAdjacentText("afterend", " ");
|
item.insertAdjacentText("afterend", " ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
const content = Lute.EscapeHTMLStr(rangeContents.textContent);
|
const content = Lute.EscapeHTMLStr(rangeContents.textContent);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user