Skip to content

How I can prevent HTML encoding on script content? #1516

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

Open
shahroz-ansari opened this issue Feb 12, 2025 · 3 comments
Open

How I can prevent HTML encoding on script content? #1516

shahroz-ansari opened this issue Feb 12, 2025 · 3 comments
Labels

Comments

@shahroz-ansari
Copy link

shahroz-ansari commented Feb 12, 2025

Version
2.47.3

I am adding inline script through codeview, after moving to editor view my script content get modified, i.e., alert("hi"); gets converted into alert("hi!");.
How can i prevent it?
@JiHong88 ?

@JiHong88
Copy link
Owner

{ __allowedScriptTag: true }

@shahroz-ansari
Copy link
Author

Thanks a lot @JiHong88 for replying this quick.

I've already added __allowedScriptTag to allow inline JS. But the issue is when I am writing inline JS through codeview and switching back to editor it is sanitizing my HTML contents along with inline JS and converting the quotes of JS to HTML entities i.e., alert("hi") to alert("hi!") which seems to be an invalid JS.

@shahroz-ansari
Copy link
Author

Thanks a lot @JiHong88 for replying this quick.

I've already added __allowedScriptTag to allow inline JS. But the issue is when I am writing inline JS through codeview and switching back to editor it is sanitizing my HTML contents along with inline JS and converting the quotes of JS to HTML entities i.e., alert("hi") to alert("hi!") which seems to be an invalid JS.

@JiHong88 can you please let me know if there is a way I can fix the it?

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

No branches or pull requests

2 participants