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

Added a flag url_can_bi_iri that allows disabling IRI parsing #56

Merged
merged 3 commits into from
Jun 24, 2023

Conversation

serega
Copy link
Contributor

@serega serega commented Jan 20, 2023

linkify by default parses Internationalized Resource Identifiers (IRI) according to rfc3987. As mentioned in #49 this behavior incorrectly extracts links without scheme when surrounded by Unicode characters without a space, which is valid in some languages. So, 地址example.org is a valid IRI, but the desired behavior is to extract URL example.org.
I added flag to url_can_be_iri that when set to false disables parsing unicode characters. The default behavior is unchanged.
LinkKind is meant to be extendable for other types of links, and I thought adding LinkKind::Iri, but that would make the library backwards incompatible.

Copy link
Owner

@robinst robinst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thanks for your patience. I have one inline comment, otherwise looks good.

src/domains.rs Show resolved Hide resolved
@robinst robinst merged commit 7331d75 into robinst:main Jun 24, 2023
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 this pull request may close these issues.

2 participants