Issue #2867Opened July 1, 2020by Lostpixelr0 reactions

[Question] not escape html characters in textNodes?

Question

Hi,

Code SnippetTEXT
We are using some Twig template features in our grapesjs implementation. 
like: {% if variable == "value" %}<b>text</b>{% endif %} 

But due to the toHtml() function in src/dom_components/model/ComponentTextNode.js this gets converted into 
{% if variable == &quote;value&quote; %}<b>text</b>{% endif %}

Is there an easy way to not replace these values in a textNode  or replace the function with our own toHtml function ? 

Btw it used to be:  (which would've been awesome for us) 
toHTML() {
      return this.get('content');
}

Answers (1)

artfJuly 5, 20200 reactions

Yeah sure, you can extend the textnode component and use your toHTML function

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...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.