mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-07 16:04:19 +01:00
This commit is contained in:
parent
14424d3dc0
commit
804ca9710e
1 changed files with 9 additions and 2 deletions
|
|
@ -595,7 +595,13 @@ export class Toolbar {
|
|||
// 数学公式后面处理
|
||||
} else {
|
||||
if (newNodes[0].firstChild) {
|
||||
this.range.setStart(newNodes[0].firstChild, 0);
|
||||
if (newNodes[0].firstChild.textContent === Constants.ZWSP) {
|
||||
// 新建元素时光标消失 https://github.com/siyuan-note/siyuan/issues/6481
|
||||
// 新建元素粘贴后元素消失 https://ld246.com/article/1665556907936
|
||||
this.range.setStart(newNodes[0].firstChild, 1);
|
||||
} else {
|
||||
this.range.setStart(newNodes[0].firstChild, 0);
|
||||
}
|
||||
} else if (newNodes[0].nodeType === 3) {
|
||||
this.range.setStart(newNodes[0], 0);
|
||||
} else {
|
||||
|
|
@ -627,7 +633,8 @@ export class Toolbar {
|
|||
if (lastNewNode.lastChild) {
|
||||
if (lastNewNode.lastChild.textContent === Constants.ZWSP) {
|
||||
// 新建元素时光标消失 https://github.com/siyuan-note/siyuan/issues/6481
|
||||
this.range.collapse();
|
||||
// 新建元素粘贴后元素消失 https://ld246.com/article/1665556907936
|
||||
this.range.collapse(true);
|
||||
} else {
|
||||
this.range.setEnd(lastNewNode.lastChild, lastNewNode.lastChild.textContent.length);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue