mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-05 16:28:49 +01:00
This commit is contained in:
parent
38e402fd39
commit
fca8e62c05
1 changed files with 7 additions and 2 deletions
|
|
@ -604,11 +604,16 @@ export class Toolbar {
|
|||
for (let i = newNodes.length - 1; i > -1; i--) {
|
||||
this.range.insertNode(newNodes[i]);
|
||||
}
|
||||
// 不选中后,ctrl+g 光标重置
|
||||
if (newNodes.length === 1 && newNodes[0].textContent === Constants.ZWSP) {
|
||||
this.range.setStart(newNodes[0], 1);
|
||||
this.range.collapse(true);
|
||||
keepZWPS = false;
|
||||
if (newNodes[0].nodeType !== 3) {
|
||||
// 不选中后,ctrl+g 光标重置
|
||||
const currentType = ((newNodes[0] as HTMLElement).getAttribute("data-type") || "").split(" ");
|
||||
if (currentType.includes("code") || currentType.includes("tag") || currentType.includes("kbd")) {
|
||||
keepZWPS = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!keepZWPS) {
|
||||
// 合并元素
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue