Skip to content

Commit

Permalink
🐛 fix #9411
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Oct 15, 2023
1 parent 99e3f12 commit 166dd4a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/src/protyle/util/insertHTML.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {hasClosestBlock, hasClosestByAttribute, hasClosestByClassName} from "./hasClosest";
import {hasClosestBlock, hasClosestByAttribute, hasClosestByClassName, hasClosestByMatchTag} from "./hasClosest";
import * as dayjs from "dayjs";
import {transaction, updateTransaction} from "../wysiwyg/transaction";
import {getContenteditableElement, hasNextSibling, hasPreviousSibling} from "../wysiwyg/getBlock";
Expand All @@ -20,7 +20,12 @@ export const insertHTML = (html: string, protyle: IProtyle, isBlock = false,
fixTableRange(range);
let tableInlineHTML;
if (hasClosestByAttribute(range.startContainer, "data-type", "NodeTable") && !isBlock) {
tableInlineHTML = protyle.lute.BlockDOM2InlineBlockDOM(html);
if (hasClosestByMatchTag(range.startContainer, "table")) {
tableInlineHTML = protyle.lute.BlockDOM2InlineBlockDOM(html);
} else {
// https://github.com/siyuan-note/siyuan/issues/9411
isBlock = true;
}
}
let blockElement = hasClosestBlock(range.startContainer) as Element;
if (!blockElement) {
Expand Down

0 comments on commit 166dd4a

Please sign in to comment.