|
@@ -1,4 +1,4 @@
|
|
-import {hasClosestBlock, hasClosestByAttribute, hasClosestByClassName} from "./hasClosest";
|
|
|
|
|
|
+import {hasClosestBlock, hasClosestByAttribute, hasClosestByClassName, hasClosestByMatchTag} from "./hasClosest";
|
|
import * as dayjs from "dayjs";
|
|
import * as dayjs from "dayjs";
|
|
import {transaction, updateTransaction} from "../wysiwyg/transaction";
|
|
import {transaction, updateTransaction} from "../wysiwyg/transaction";
|
|
import {getContenteditableElement, hasNextSibling, hasPreviousSibling} from "../wysiwyg/getBlock";
|
|
import {getContenteditableElement, hasNextSibling, hasPreviousSibling} from "../wysiwyg/getBlock";
|
|
@@ -20,7 +20,12 @@ export const insertHTML = (html: string, protyle: IProtyle, isBlock = false,
|
|
fixTableRange(range);
|
|
fixTableRange(range);
|
|
let tableInlineHTML;
|
|
let tableInlineHTML;
|
|
if (hasClosestByAttribute(range.startContainer, "data-type", "NodeTable") && !isBlock) {
|
|
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;
|
|
let blockElement = hasClosestBlock(range.startContainer) as Element;
|
|
if (!blockElement) {
|
|
if (!blockElement) {
|