Issue #2069πŸ’¬ AnsweredOpened June 6, 2019by Sparragus0 reactions

`allowScripts: true` still deletes <script> tags

Quick answerby dosponsor

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)

dosponsorβ€’ June 13, 2019

Can you please provide the solution for this issue.

artfβ€’ June 14, 2019

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

Sparragusβ€’ June 24, 2019

@artf Thank you for the clarification. Cheers.

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.