and the editor is broken. Actually, there is an option that kind of indicates that is by design placeholderScript | Content to show when the custom code contains
Issue #3245💬 AnsweredOpened January 21, 2021by bgrand-ch0 reactions

Grapesjs-custom-code doesn't execute <script> from GrapesJS 0.16.30 and up

Quick answerby nithinpillalamarri123

hi very thanks for u r replay... yes exactly , after you are replay i tried with 0.16.27 custom blocks script is working as expected but in above versions than 0.16.27 while drag and drop custom block script executing as expected but after saving and reloading the template using editor.setComponents(html text as Strin...

Read full answer below ↓

Question

grapesjs-custom-code work fine with script tag until GrapesJS 0.16.27, after this version, no script content is executed.

✔️ Editor init() option : allowScripts: 1 ✔️ Plugin import : https://github.com/artf/grapesjs-custom-code/issues/11#issuecomment-724512902

Is it related to https://github.com/artf/grapesjs/issues/3244 ?

Answers (3)

nithinpillalamarri123January 21, 2021

hi very thanks for u r replay... yes exactly , after you are replay i tried with 0.16.27 custom blocks script is working as expected but in above versions than 0.16.27 while drag and drop custom block script executing as expected but after saving and reloading the template using editor.setComponent...

artfJanuary 28, 2021

Hi @bgrand-ch probably you're talking about a fixed bug 😂 Main reasons why you should not let execute a random script from a user:Self-XSSWe can't control the script if we execute it inside the editor, so, for instance, the user paste this <script>document.body.innerHTML = "";</script> and the edi...

GJSBlockMay 17, 2026

Thanks for reporting this, @bgrand-ch. Great suggestion about grapesjs-custom-code doesn't execute <script> from GrapesJS 0.16.30 and up! While this specific feature isn't yet in the core API, there are several ways to achieve similar behavior. Using the event system: Alternative approaches: Listen...

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 →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.