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

infinite loop #4841

Open
kaniansky opened this issue Nov 6, 2024 · 1 comment
Open

infinite loop #4841

kaniansky opened this issue Nov 6, 2024 · 1 comment

Comments

@kaniansky
Copy link

Expected behavior.

text is inserted

Actual behavior.

whole page freezes on infinite loop because some string gets wrongly trimmed using regex /\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/
changing it to /\/\*[\s\S]*?\*\/|([^\\:'"]|^)\/\/ fixes the problem
it seems it's trying to remove comments but here the double slash is not a comment

Steps to reproduce the problem.
  • have a HTML with ".selector { @font-face { font-family: font; src: url("//path/to/font.ttf") format("truetype"); } }
  • try to paste the text using html.set
  • whole browser freezes
Editor version.

4.2.1

OS.

MacOS

Browser.

Chrome / Safari

@sooohka
Copy link

sooohka commented Dec 3, 2024

thanks @kaniansky

before passing data to froala doing this worked for me

data.description.replace(/\/\*[\s\S]*?\*\/|([^\\:'"]|^)\/\//gi,'')

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