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
parent
commit
0ff35bbbc5
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 3
      src/parser/model/ParserHtml.ts

3
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;
}
}

Loading…
Cancel
Save