`allowScripts: true` still deletes <script> tags
Can you please provide the solution for this issue.
Read full answer below βQuestion
Hi all. Thanks for creating and maintaining this amazing project. π Bug Description I have a block that inserts a script as specified here: https://grapesjs.com/docs/modules/Components-js.html#basic-scripts When I drag the block to the canvas, the component will indeed have the script attached to itself. However, when I reload the page, the script is no longer there. I've seen multiple issues where this is discussed, and they all seem to be resolve by adding Examples: https://github.com/artf/grapesjs/issues/1123 https://github.com/artf/grapesjs/issues/837 https://github.com/artf/grapesjs/iss...
Answers (3)
Can you please provide the solution for this issue.
Thanks for the report @Sparragus The problem here is when you use a function for the script inside Blocks. When the editor tries to store the JSON the structure is serialized but the function is not serializable so for that component an empty script string is stored. I know that is what we indicate...
@artf Thank you for the clarification. Cheers.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #4606
A script delcaration mistake at "Commponent & JS" documentation page.
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? irrelevant to the issue Reproducible demo...
Issue #1569
Components & JS Question
Hi, In your Components & JS documentation, it is mentioned that scripts can be added into the "block" section under a script attribute. How...
Issue #5525
Performance issue when adding more than 20 classes to a single component
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Edge v119.0.2151.72 Reproducible demo link...
Issue #3579
RTE misplaced when opened right after dropping `activeOnRender` component
Version: 0.17.4 Are you able to reproduce the bug from the demo?[x] Yes[ ] No Steps to reproduce:Go to the demoDrop a "Text" block inside t...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins β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.