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

Extreme slowdown on missing space after mail link #647

Closed
stgm opened this issue Mar 24, 2020 · 5 comments
Closed

Extreme slowdown on missing space after mail link #647

stgm opened this issue Mar 24, 2020 · 5 comments
Assignees
Labels

Comments

@stgm
Copy link

stgm commented Mar 24, 2020

We have a document that takes forever to parse, because the author forgot to insert a space after an e-mail link. It looks like this:

Stuur een mail naar <progik@mprog.nl>stel een vraag

I noticed that the parser takes noticeably longer even when I cut off the document just 10-20 characters after that link. The more characters that follow the missing space, the longer the parser takes. For the whole document, it took 25 seconds to parse :-)

We're on the Kramdown 2.1.0 gem in a Rails project.

@gettalong gettalong self-assigned this Mar 30, 2020
@gettalong
Copy link
Owner

I'm sorry, the link you gave says "404 not found" but I could reproduce the problem using your example and adding content after it. And it seems that the problem quickly escalates....

@gettalong gettalong added the bug label Mar 30, 2020
@gettalong
Copy link
Owner

So it seems that problem is the regex for detecting the link, will see what I can do about it.

@gettalong
Copy link
Owner

I looked at the regex. It tries to match an email address with some restrictions. However, if one uses mailto:..., then no such restrictions are checked. Therefore I will just relax the regex to allow a more arbitrary string of the form ...@....

@gettalong
Copy link
Owner

Fix will be in the next release!

@stgm
Copy link
Author

stgm commented Mar 31, 2020

Thanks, very cool! :-)

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