Issue #1466Opened September 27, 2018by sfkazmi0 reactions

Editing Saved html editor.setComponents slider load issue

Question

I am working on a project where i integrated grapesJs for users to build there templates, save them in database and edit these saved templates.

I recently added slider plugin and now user can create templates but when edit i cause issue with javascript, I am using editor.setComponents when a user edit template and adding saved html in editor.setComponent('<saved html>') and css in editor.setStyle('<saved style>'),

Now when there is some kind of javascript in saved html like slider javascript and when comes the apostrophe (') in javascript it breaks the script and throw exception,

i can manulay pass these html and css in <div id="gjs"> but there body background css not works. What is batter solution for that??

editor.setComponents('{!! $template->html !!}'); editor.setStyle('{!! $template->css !!}'); editor.store();

i am using laravel and loading templates html and css like this

Answers (3)

sfkazmiSeptember 28, 20180 reactions

i got a way to fix it, I directly passed the html and css content in <div>.

sfkazmiSeptember 28, 20180 reactions

I got a new issue, when i pass the css in <div> to render it and html, i change the style and get it with editor.getCss(); it gets the old style that i passed into style tag in <div>

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.