Issue #6570πŸ’¬ AnsweredOpened Jul 20, 2025by nanto0 reactions

Parser ignores `parser.optionsHtml.keepEmptyTextNodes` option

Quick answerby GJS Helper

You've accurately identified a discrepancy in how the keepEmptyTextNodes option is handled in GrapesJS, leading to newlines being stripped from your HTML output. This is indeed a bug related to the parser's configuration and its TypeScript definitions. Root Cause The GrapesJS HTML parser (specifically the ParserHtml m...

Read full answer below ↓

Question

GrapesJS version [x] I confirm to use the latest version of GrapesJS What browser are you using? Chrom v140.0.7307.0 (canary) Reproducible demo link https://jsfiddle.net/y3gr69s4/ Describe the bug How to reproduce the bug? Create editor instance with parser.optionsHtml.keepEmptyTextNodes option set true. Load HTML code that contains newlines between elements. Get HTML code. What is the expected behavior? The resulting HTML code still contains newlines between elements. What is the current behavior? Newlines between elements are stripped from the resulting HTML code. We get the expected result...

Answers (1)

GJS Helperβ€’ May 17, 2026

You've accurately identified a discrepancy in how the keepEmptyTextNodes option is handled in GrapesJS, leading to newlines being stripped from your HTML output. This is indeed a bug related to the parser's configuration and its TypeScript definitions. Root Cause The GrapesJS HTML parser (specifica...

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins β†’
Premium option

Premium plugins ship with support, regular updates, and production-ready features β€” save days of integration work.

Browse premium plugins β†’

Related tutorials

In-depth guides on the same topic.

All tutorials β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.