Issue #1577đź’¬ AnsweredOpened November 14, 2018by emilsedgh1 reactions

Inline CSS Comments break Code Manager

Quick answerby emilsedgh❤ 1

Alright I finally managed to reproduce this again. Reopening with better fiddle. The code inside gjs is The CSS retrieved by editor.getCss() is: The bug is that the /* color:#ffffff; doesn't have the closing comment tag. Therefore, it'd render any css that comes after it. My apologies for the late response.

Read full answer below ↓

Question

Apparently this is valid piece of html and css: <div style="color: red; / height 200px; /; font-weight: bold;"> (Hence the commented out height property) Grapesjs has trouble dealing with such attribute as the style attribute on the model is stored as this: The big problem is that CssGenerator's buildFromObject considers / as part of the rule name for / height, and concatenates it the whole css string. So the css code is basically commented out when it reaches this model and is rendered unusable blob of commented out css. Obviously the real fix is not on CodeManager. Whoever parses /* height...

Answers (3)

emilsedgh• August 24, 2019

Alright I finally managed to reproduce this again. Reopening with better fiddle. The code inside gjs is The CSS retrieved by editor.getCss() is: The bug is that the /* color:#ffffff; doesn't have the closing comment tag. Therefore, it'd render any css that comes after it. My apologies for the late...

no-response[bot]• November 26, 2018

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we ne...

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.