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

Bad regex causing very slow execution #112

Open
kduffie opened this issue Oct 14, 2020 · 0 comments
Open

Bad regex causing very slow execution #112

kduffie opened this issue Oct 14, 2020 · 0 comments

Comments

@kduffie
Copy link

kduffie commented Oct 14, 2020

If you attempt to run unfluff on the body of the following webpage, https://craftsbyamanda.com/vibrant-button-tree-on-canvas-a-giveaway/ you'll see that it takes more than 10secs on a fast Mac.

The problem has been isolated to line 22 of lib/extractor.js which takes around 10s to execute when operating on the contents of that particular webpage:

copyright = text.replace(/.*?©(\s*copyright)?([^,;:.|\r\n]+).*/gi, '$2').trim();
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

1 participant