mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-10 06:32:33 +01:00
This commit is contained in:
parent
cd3da736db
commit
772dee2fc7
3 changed files with 9 additions and 2 deletions
|
|
@ -116,6 +116,9 @@ export const getEditorRange = (element: Element) => {
|
|||
targetElement = getContenteditableElement(element);
|
||||
if (!targetElement) {
|
||||
targetElement = element;
|
||||
} else if (targetElement.tagName === "TABLE") {
|
||||
// 文档中开头为表格,获取错误 https://ld246.com/article/1663408335459?r=88250
|
||||
targetElement = targetElement.querySelector("th") || element.querySelector("td");
|
||||
}
|
||||
}
|
||||
range = targetElement.ownerDocument.createRange();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue