[Question] How to allow special characters in class name or data attribute?
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,
<div class="list-container" data-page-id="{{page.id}}">
<ul class="{{list.className}}" data-list-id="{{list.id}}">
<li data-list-id="{{list.item.id}}">List Item 1</li>
<li data-list-id="{{list.item.id}}">List Item 2</li>
</ul>
</div>
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,
<div data-page-id="{{page.id}}" class="list-container">
<ul data-list-id="{{list.id}}" class="-list-className-">
<li data-list-id="{{list.item.id}}">List Item 1
</li>
<li data-list-id="{{list.item.id}}">List Item 2
</li>
</ul>
</div>
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)
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.
Issue #2207
[BUG]: Can't drag component if there is some space on top/left with Mode Absolute
Given the following code example... Results in no ability to drag and drop elements to correct position using drag icon on the panel. See F...
Issue #1526
[QUESTION] how to make fullscreen command
Hi, unfortunately I do not find documentation and can't manage to get it understand from code: I know there is a built-in command 'fullscre...
Issue #1577
Inline CSS Comments break Code Manager
Apparently this is valid piece of html and css: <div style="color: red; / height 200px; /; font-weight: bold;"> (Hence the commented out he...
Issue #1434
Toolbar Hide text element
@artf Please check you demo page text is hiding under the toolbar. how can we update the toolbar position?
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.