Issue #677Opened December 23, 2017by mingodad0 reactions

Escape html

Question

Hello ! I noticed several faults in escaping html through grapesjs some of it can be fixed by this pull request https://github.com/artf/grapesjs/pull/676 , but I still having problems with the html inserted on start.

In the example bellow the first <pre> is not rendered properly and I need to double escape it like on the second <pre> to get it properly rendered and be able to import/export after that properly.

Somehow between the several transformations applied to the initial html it get screwed.

			<div class="buttons">
				<h1>Buttons</h1>
				<a class="btn smooth btn-a">btn-a</a>
			
				<br><br><pre>&lt;a class="btn btn-b smooth"&gt;btn-b&lt;/a&gt;</pre>
				<br>
				<a class="btn smooth btn-a btn-sm">btn-sm btn-a</a>
				
				<br><br><pre>&amp;lt;a class="btn btn-b btn-sm smooth"&amp;gt;btn-sm&amp;lt;/a&amp;gt;</pre>
			</div>

Answers (2)

artfDecember 27, 20170 reactions

As already mentioned here we have to create a new Component for <pre> as escaping everything it's not an option

lock[bot]September 17, 20190 reactions

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

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.