Browse Source
Merge pull request #2 from bernesto/Parser-update
Address some logic issues in the HTML parser
pull/5719/head
Brian Ernesto
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
2 additions and
1 deletions
-
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; |
|
|
|
} |
|
|
|
} |
|
|
|
|