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

Fix linkify to only match valid URI characters #75

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

perlpunk
Copy link
Contributor

Fixes #63

It handles the fact that escapeForHtml has already been called and matches & separately.

I used the RFC (basically the last 5 rules) from:
https://datatracker.ietf.org/doc/html/rfc3986#appendix-A

I tested it with:

# "> should be excluded
"https://github.com/os-autoinst/openQA.git"
<https://github.com/os-autoinst/os-autoinst.git>
# () should be included
https://de.wikipedia.org/wiki/Queen_(Band)
# query strings should be included
https://github.com/os-autoinst/openQA?foo=1%20&bar=*2

I am not sure how to run the tests. If you give me a hint, I will try and add a test for this.

Copy link

@b10n1k b10n1k left a comment

Choose a reason for hiding this comment

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

I guess you will have to update also the README, DOCUMENTATION.md and not sure if there is any other ref

@perlpunk
Copy link
Contributor Author

I guess you will have to update also the README, DOCUMENTATION.md and not sure if there is any other ref

That seems to be generated from the actual function documentation (I hope it's not manually duplicated). And that is often something which is done by the person who releases the library, directly before the release. I prefer to leave such things unless I'm explicitly asked to do it.
@IonicaBizau will tell me :)

Fixes IonicaBizau#63

It handles the fact that escapeForHtml has already been called and
matches `&amp;` separately.

I used the RFC (basically the last 5 rules) from:
https://datatracker.ietf.org/doc/html/rfc3986#appendix-A
@IonicaBizau
Copy link
Owner

Thank you very much for fixing this!

@IonicaBizau IonicaBizau mentioned this pull request Sep 22, 2024
@perlpunk
Copy link
Contributor Author

Hm, it was never merged. I think it's not in the release https://github.com/IonicaBizau/anser/releases/tag/2.2.0

@IonicaBizau IonicaBizau mentioned this pull request Sep 26, 2024
@IonicaBizau IonicaBizau merged commit ad5af38 into IonicaBizau:master Sep 26, 2024
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.

Linkify breaks with URLs surrounded by color codes
5 participants