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

URL Detection #64

Closed
krjackso opened this issue Apr 15, 2016 · 5 comments · Fixed by #69
Closed

URL Detection #64

krjackso opened this issue Apr 15, 2016 · 5 comments · Fixed by #69

Comments

@krjackso
Copy link
Contributor

I noticed in my app that the word "picture" is detected as a URL. After looking into it, I noticed that any phrase starting with "www" or "pic" will get detected as a URL, even though they are not valid URLs. Looking at the history, we used to use NSDataDetector but switched to a regex. Is there a compelling reason not to use NSDataDetector for this? The only test that fails using NSDataDetector is that "google.com" gets detected as a URL when the test does not want it to be (I would actually prefer it to be). Right now I am running with my fork that uses NSDataDetector until this can be resolved.

@polqf
Copy link
Contributor

polqf commented Apr 15, 2016

Hi @krjackso, I am sorry for the issue, we should take a look at the regex for the urls. The reason why we switched from NSDataDetector to regex is that data detector is 2x more expensive.

See #40 (comment)

Seems like NSDataDetector is slower than a custom Regex (2x the time)... Maybe we should move to a regex for the URLs?

@krjackso
Copy link
Contributor Author

Yeah URL regexes are a real pain :) Perhaps a decent compromise would be opening up the RegexParser so that we can override the different types of detectors if we need them to be different? The other thing I like about using NSDataDetector for URLs is it will be consistent with other things using it to detect links which will be important for my users who are mostly coming from the bundled iOS apps.

@polqf
Copy link
Contributor

polqf commented Apr 15, 2016

Yep, i like the idea, but in order to fix and add tests for it, I would like to know first which text is being detected as url, and it is not. Even if we open the Regex parser, there should be a default regex.

@Abdul-Moiz
Copy link

Hi, I am still detecting "picture." highlighted as a URL.
picturedetection
This issue is still not resolved.

@polqf polqf reopened this Jun 4, 2016
@polqf
Copy link
Contributor

polqf commented Oct 14, 2016

Not able to reproduce, closing...

@polqf polqf closed this as completed Oct 14, 2016
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 a pull request may close this issue.

3 participants