Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script Tag is sanitized in the output #35

Open
thequickcode opened this issue Apr 22, 2024 · 3 comments
Open

Script Tag is sanitized in the output #35

thequickcode opened this issue Apr 22, 2024 · 3 comments

Comments

@thequickcode
Copy link

Hello,

When using the following custom code

<script> alert('hi') </script>

The result would sanitize the script tag as following

 &lt;script&gt;alert('hi')&lt;/script&gt;

Am I missing anything?

@quentin-bettoum
Copy link

Hello,

You could try with this config and see if it works for you:

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

@thequickcode
Copy link
Author

I used the following configs:

grapesjs.init({
        allowScripts: true,

@quentin-bettoum
Copy link

I used the following configs:

grapesjs.init({
        allowScripts: true,

This one is deprecated, it might not work anymore in the future.

@deprecated in favor of `config.parser.optionsHtml.allowScripts`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants