Issue #1915πŸ’¬ AnsweredOpened Mar 22, 2019by arachnosoft0 reactions

Grapesjs strips   entities (mostly inserted by CKEditor)

Quick answerby artf

I think the issue might be here https://github.com/artf/grapesjs/blob/0a122cd7b558bcf391cfd7e4608dffad3ba9de53/src/parser/model/ParserHtml.js#L169-L172 unfortunately nodeValue returns already processed string, without   Try to use this option: https://github.com/artf/grapesjs/blob/0a122cd7b558bcf391cfd7e4608dffad...

Read full answer below ↓

Question

Hi @artf , We have just noticed that, if you import this code into grapesjs: <label class="c3100 c3152 c3212" style="box-sizing: border-box;">My label field 1</label>&nbsp; <label class="c3111 c3163 c3223" style="box-sizing: border-box;">My label field 2</label> With an &nbsp; between the two label tags, the &nbsp; is being stripped from the code, leaving the two <label> tags "glued" together. I reproduced the issue with the Newsletter demo: If I put anything else between the two (even, sometimes... real spaces), everything is kept. Do you know if there's any explicit &nbsp; removal code some...

Answers (3)

artfβ€’ Mar 24, 2019

I think the issue might be here https://github.com/artf/grapesjs/blob/0a122cd7b558bcf391cfd7e4608dffad3ba9de53/src/parser/model/ParserHtml.js#L169-L172 unfortunately nodeValue returns already processed string, without &nbsp; Try to use this option: https://github.com/artf/grapesjs/blob/0a122cd7b558...

arachnosoftβ€’ Mar 25, 2019

Thank you very much for the tip @artf , this (undocumented?) Parser config option seems to solve my issue! Of course, I had to set it to true, not 0, as I wanted to keep those empty spaces ;) And had to set it on the editor.Parser.getConfig() object. Setting this option through grapesjs.init() has...

lock[bot]β€’ Mar 27, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

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.