mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-01 06:18:49 +01:00
This commit is contained in:
parent
395223d701
commit
92a1af3b7f
1 changed files with 4 additions and 0 deletions
|
|
@ -305,6 +305,10 @@ export const setFirstNodeRange = (editElement: Element, range: Range) => {
|
|||
}
|
||||
let firstChild = editElement.firstChild as HTMLElement;
|
||||
while (firstChild && firstChild.nodeType !== 3 && !firstChild.classList.contains("render-node")) {
|
||||
if (firstChild.classList.contains("img")) { // https://ld246.com/article/1665360254842
|
||||
range.setStartBefore(firstChild);
|
||||
return range;
|
||||
}
|
||||
firstChild = firstChild.firstChild as HTMLElement;
|
||||
}
|
||||
if (!firstChild) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue