♻️ rm hasClosestByMatchTag

This commit is contained in:
Vanessa 2025-02-09 12:04:40 +08:00
parent 9885e6eb9b
commit 2408f8a0ba
15 changed files with 50 additions and 70 deletions

View file

@ -1,4 +1,4 @@
import {hasClosestBlock, hasClosestByAttribute, hasClosestByClassName, hasClosestByMatchTag} from "./hasClosest";
import {hasClosestBlock, hasClosestByAttribute, hasClosestByClassName, hasClosestByTag} from "./hasClosest";
import * as dayjs from "dayjs";
import {transaction, updateTransaction} from "../wysiwyg/transaction";
import {getContenteditableElement} from "../wysiwyg/getBlock";
@ -290,7 +290,7 @@ export const insertHTML = (html: string, protyle: IProtyle, isBlock = false,
fixTableRange(range);
let tableInlineHTML;
if (hasClosestByAttribute(range.startContainer, "data-type", "NodeTable") && !isBlock) {
if (hasClosestByMatchTag(range.startContainer, "TABLE")) {
if (hasClosestByTag(range.startContainer, "TABLE")) {
tableInlineHTML = protyle.lute.BlockDOM2InlineBlockDOM(html);
} else {
// https://github.com/siyuan-note/siyuan/issues/9411