Skip to content

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.

0 participants