From b5926fdb1298b66a1d5cc705c39f0eb5da8021d5 Mon Sep 17 00:00:00 2001 From: Brian Ernesto Date: Thu, 7 Mar 2024 11:44:46 -0700 Subject: [PATCH] Address some logic issues in the HTML parser --- src/parser/model/ParserHtml.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/parser/model/ParserHtml.ts b/src/parser/model/ParserHtml.ts index 42482c27a..4f09aba1b 100644 --- a/src/parser/model/ParserHtml.ts +++ b/src/parser/model/ParserHtml.ts @@ -245,7 +245,8 @@ const ParserHtml = (em?: EditorModel, config: ParserConfig & { returnArray?: boo // Throw away empty nodes (keep spaces) if (!opts.keepEmptyTextNodes) { const content = node.nodeValue; - if (content != ' ' && !content!.trim()) { + // Handle all white spaces. This checks for tabs, newlines, and multiple spaces + if (content!.length > 0 && content!.trim() !== '') { continue; } }