🎨 清除行级元素会把内容也清空

This commit is contained in:
Vanessa 2024-09-16 10:30:20 +08:00
parent 5823f802de
commit 22ffd923d3

View file

@ -600,7 +600,7 @@ export class Toolbar {
for (let i = 0; i < newNodes.length; i++) {
const currentNewNode = newNodes[i] as HTMLElement;
const nextNewNode = newNodes[i + 1] as HTMLElement;
const currentType = currentNewNode.getAttribute("data-type") || "";
const currentType = currentNewNode.nodeType !== 3 ? (currentNewNode.getAttribute("data-type") || "") : "";
if (currentNewNode.nodeType !== 3 && nextNewNode && nextNewNode.nodeType !== 3 &&
nextNewNode.tagName === currentNewNode.tagName &&
// 表格内多个换行 https://github.com/siyuan-note/siyuan/issues/12300