Issue #2867💬 AnsweredOpened July 1, 2020by Lostpixelr0 reactions

Not escape html characters in textNodes?

Quick answerby artf

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

Read full answer below ↓

Question

Hi,

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, 2020

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

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 →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.