grapesjs-custom-code icon indicating copy to clipboard operation
grapesjs-custom-code copied to clipboard

Cannot import template with <scrip>

Open nuvolettablu opened this issue 1 year ago • 2 comments

When importing a template that contains a script, the script portion is not imported. Even when using the "code" module, the result is the same.

This is despite enabling the allowScripts configuration option when initializing your GrapesJS editor.

const editor = grapesjs.init({
    ... // the rest of your GrapesJS config
    allowScripts: 1,
});

Any ideas? Thanks. S.

nuvolettablu avatar Apr 22 '24 11:04 nuvolettablu

This allowScripts parameter has apparently been deprecated.

You should try this:

grapesjs.init({
  ...
  parser: {
    optionsHtml: {
      allowScripts: true,
    },
  },
});

quentin-bettoum avatar May 20 '24 14:05 quentin-bettoum