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

fix infinite loop caused by comment regexp in htmltag module #307

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

fix infinite loop caused by comment regexp in htmltag module #307

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Aug 17, 2018

I don't know why comment regexp looks like this: /<!--([^-]+|[-][^-]+)*-->/, maybe for some specific rules.

But I found that /<!--([^-]+|[-][^-]+)*-->/ can't match something like this: <!-- a--z -->, which is obviously a html comment.

More importantly, this regexp /<!--([^-]+|[-][^-]+)*-->/ may cause infinite loop and break down the browser.

See my issue before.

I positioned the bug, but have no idea why this regexp should cause infinite loop.

I rewrite it to /<!--[\s\S]*?-->/ and make this pull request.

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

Successfully merging this pull request may close these issues.

None yet

0 participants