mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-10 22:52:34 +01:00
This commit is contained in:
parent
f40529c362
commit
9831a3d2c6
2 changed files with 9 additions and 32 deletions
|
|
@ -582,6 +582,11 @@ export const focusBlock = (element: Element, parentElement?: HTMLElement, toStar
|
|||
if (cursorElement.classList.contains("hljs")) {
|
||||
// 代码块末尾定位需在 /n 之前 https://github.com/siyuan-note/siyuan/issues/9141,https://github.com/siyuan-note/siyuan/issues/9189
|
||||
let lastNode = cursorElement.lastChild;
|
||||
if (!lastNode) {
|
||||
// 粘贴 ``` 报错
|
||||
cursorElement.innerHTML = "\n";
|
||||
lastNode = cursorElement.lastChild;
|
||||
}
|
||||
if (lastNode.textContent === "" && lastNode.nodeType === 3) {
|
||||
lastNode = hasPreviousSibling(cursorElement.lastChild) as HTMLElement;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue