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 does not pass as expected #8

Open
digitalanalogue opened this issue Mar 9, 2021 · 2 comments
Open

Url does not pass as expected #8

digitalanalogue opened this issue Mar 9, 2021 · 2 comments

Comments

@digitalanalogue
Copy link

This url: https://www.php.net/manual/en/language.oop5.overloading.php#object.call

Gives these results:

{ "value": { "url": "https://www.php.net/manual/en/language.oop5.overloading.php#object.call", "normalizedUrl": "https://www.ph/manual/en/language.oop5.overloading.php#object.call", "removedTailOnUrl": "", "protocol": "https", "onlyDomain": "www.ph", "onlyParams": null, "onlyUri": "/manual/en/language.oop5.overloading.php#object.call", "onlyUriWithParams": "/manual/en/language.oop5.overloading.php#object.call", "onlyParamsJsn": null, "type": "domain", "port": null }, "area": "text" }

When used like so:

Pattern.TextArea.extractAllFuzzyUrls('https://www.php.net/manual/en/language.oop5.overloading.php#object.call');

I'm using this within a browser (firefox 86 on OSX).

I expect the onlyDomain to be www.php.net

Great project btw, just found this bug when messing about with pasting in urls.

@digitalanalogue
Copy link
Author

digitalanalogue commented Mar 10, 2021

Also found domains with hypens like this http://sub.do-main.co.uk/ do not work and come out like http://sub.do.main.co.uk/

Not sure if this is due to using extractAllFuzzyUrls and not extractAllUrls, if I use the later it works as expected. Not sure if this is really an error or to be expected when using fuzzy - my aim was to catch as many bad url's as possible but extractAllUrls works well enough for what I want.

@patternknife
Copy link
Owner

You are right. extractAllUrls is currently a recommended method to extract URLs, but extractAllFuzzyUrls is kind of an experimental thing to extract corrupted ones. I will look into extractAllFuzzyUrls for the issue later.

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

2 participants