Issue #1703✓ SolvedOpened January 3, 2019by narendravaghela3 reactions

How to allow special characters in class name or data attribute?

Quick answerby artf3

The escape function is applied in the Selector model. I think it might be a good idea to provide some option as a custom escape strategy.

Read full answer below ↓

Question

In my HTML code, I have some variable placeholders defined in element's class name or data attributes. For example, consider following code block, When I load this in the editor, it removes them and I can't get them back while exporting the code via editor.getHTML(). So, the result of above code is as below, If you see the result, the class of ul element is changed from {{list.className}} to -list-className-. Is there any way to preserve them while loading and exporting the HTML? Please help. Thanks

Answers (1)

👍 Most helpfulartfJanuary 4, 2019

The escape function is applied in the Selector model. I think it might be a good idea to provide some option as a custom escape strategy.

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.