From b2562a53ad3cfab8ecee1250a713079cf48a3618 Mon Sep 17 00:00:00 2001 From: David Bacher Date: Tue, 24 Feb 2026 12:17:18 -0600 Subject: [PATCH] Flush nestedListBlock in the type-change branche, just like it's already done in the same-depth branch --- lib/draftjs-to-html.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/draftjs-to-html.js b/lib/draftjs-to-html.js index 55f02e7..de19195 100644 --- a/lib/draftjs-to-html.js +++ b/lib/draftjs-to-html.js @@ -637,6 +637,10 @@ if (!previousBlock) { listHtml.push("<".concat(getBlockTag(block.type), ">\n")); } else if (previousBlock.type !== block.type) { + if (nestedListBlock && nestedListBlock.length > 0) { + listHtml.push(getListMarkup(nestedListBlock, entityMap, hashtagConfig, directional, customEntityTransform)); + nestedListBlock = []; + } listHtml.push("\n")); listHtml.push("<".concat(getBlockTag(block.type), ">\n")); } else if (previousBlock.depth === block.depth) {