mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-14 19:18:06 +01:00
🎨 update table name https://github.com/siyuan-note/siyuan/issues/7536
This commit is contained in:
parent
edbfd54494
commit
0a915819f3
7 changed files with 76 additions and 12 deletions
|
|
@ -7,6 +7,8 @@ import {mathRender} from "../render/mathRender";
|
|||
import {Constants} from "../../constants";
|
||||
import {highlightRender} from "../render/highlightRender";
|
||||
import {scrollCenter} from "../../util/highlightById";
|
||||
import {updateAVName} from "../render/av/action";
|
||||
import {readText} from "./compatibility";
|
||||
|
||||
export const insertHTML = (html: string, protyle: IProtyle, isBlock = false,
|
||||
// 移动端插入嵌入块时,获取到的 range 为旧值
|
||||
|
|
@ -31,6 +33,22 @@ export const insertHTML = (html: string, protyle: IProtyle, isBlock = false,
|
|||
if (!blockElement) {
|
||||
return;
|
||||
}
|
||||
if (blockElement.classList.contains("av")) {
|
||||
range.deleteContents();
|
||||
const text = readText();
|
||||
if (typeof text === "string") {
|
||||
range.insertNode(document.createTextNode(text));
|
||||
range.collapse(false);
|
||||
updateAVName(protyle, blockElement);
|
||||
} else {
|
||||
text.then((t) => {
|
||||
range.insertNode(document.createTextNode(t));
|
||||
range.collapse(false);
|
||||
updateAVName(protyle, blockElement);
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
let id = blockElement.getAttribute("data-node-id");
|
||||
range.insertNode(document.createElement("wbr"));
|
||||
let oldHTML = blockElement.outerHTML;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue