Issue #476💬 AnsweredOpened November 1, 2017by Geczy0 reactions

Spans are stripped - unwanted behavior

Quick answerby Geczy

You can reproduce on http://grapesjs.com/demo-newsletter-editor.html My issue is described here https://github.com/artf/grapesjs/issues/341 https://github.com/artf/grapesjs/blob/dev/src/parser/model/ParserHtml.js#L145

Read full answer below ↓

Question

For example if I import <p><span style="font-size:50px;">hi</span></p> via grapesjs import command, the following is set as the component: <p data-highlightable="1">hi</p>. Losing my styles

Answers (3)

GeczyNovember 1, 2017

In my case it is preferable to not strip the <span> and leave it in the HTML. Why was it removed? Be careful of things like: What should the expected output be after the parser? Hi should be 50px, hey should be 12px. This is why the html parser should not remove spans

artfNovember 2, 2017

I agree with you Matt, indeed, as already mentioned, I'd like to remove it but need to find time to test it, to be sure it's not breaking other stuff. I close this in favor of #341

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.