robinst / linkify

Rust library to find links such as URLs and email addresses in plain text, handling surrounding punctuation correctly
https://robinst.github.io/linkify/
Apache License 2.0
201 stars 12 forks source link

Add support for skipping wildcard URLs #38

Closed mre closed 2 years ago

mre commented 2 years ago

URLs can contain wildcards as in http://*.example.org. These are commonly used in cases where listing all possible URLs would not be feasible, e.g. when defining Content-Security-Policy rules 1.

It can be surprising to users of linkify that these URLs get extracted. As such, this change adds support for disabling the extraction of wildcard URLs.

Fixes #37.

mre commented 2 years ago

I think I don't want to accept this in the current state, I'd rather clean up domain parsing which should hopefully make this change unnecessary.

Sure, no worries. Gonna close this PR for now. Would be glad if you could look into the domain parsing if you find some time. 👍

robinst commented 2 years ago

With the changes in 0.9.0, this is no longer a problem: https://github.com/robinst/linkify/blob/main/CHANGELOG.md#090---2022-07-11