🐛 Fix exception on paste invalid html

This commit is contained in:
Andrey Antukh 2025-05-14 11:27:10 +02:00 committed by Alejandro Alonso
parent ecb85778bc
commit 79a164be6d
5 changed files with 75 additions and 69 deletions

View file

@ -83,7 +83,10 @@ export function mapContentFragmentFromDocument(document, root, styleDefaults) {
currentNode = nodeIterator.nextNode();
}
fragment.appendChild(currentParagraph);
if (currentParagraph) {
fragment.appendChild(currentParagraph);
}
if (fragment.children.length === 1) {
const isContentInline = isContentFragmentFromDocumentInline(document);
if (isContentInline) {