mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-21 19:41:05 +08:00
This commit is contained in:
parent
395223d701
commit
92a1af3b7f
@ -305,6 +305,10 @@ export const setFirstNodeRange = (editElement: Element, range: Range) => {
|
|||||||
}
|
}
|
||||||
let firstChild = editElement.firstChild as HTMLElement;
|
let firstChild = editElement.firstChild as HTMLElement;
|
||||||
while (firstChild && firstChild.nodeType !== 3 && !firstChild.classList.contains("render-node")) {
|
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;
|
firstChild = firstChild.firstChild as HTMLElement;
|
||||||
}
|
}
|
||||||
if (!firstChild) {
|
if (!firstChild) {
|
||||||
|
Loading…
Reference in New Issue
Block a user