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

Cannot click in certain parts of short URL #1201

Closed
Luflosi opened this issue Dec 3, 2018 · 2 comments
Closed

Cannot click in certain parts of short URL #1201

Luflosi opened this issue Dec 3, 2018 · 2 comments

Comments

@Luflosi
Copy link
Contributor

Luflosi commented Dec 3, 2018

The URL http://ab.de is a valid URL, which is clickable on every character except the colon and the first slash. Looking at the code, it seems, that find_colon_slash() doesn't quite do what you may have thought it does or does something different than what it was supposed to do. When hovering over the colon, the URL is short enough so that the search starts outside (to the right of) the URL and if (!is_url_char(ch)) return false; returns immediately because the character outside the URL will not be a valid URL character. The code seems a bit too complicated. May I try to rewrite it to search from the position of the mouse cursor outward in both directions?

@Luflosi
Copy link
Contributor Author

Luflosi commented Dec 4, 2018

If I manage to simplify the URL detection code, would you maybe accept it as a pull request?

@kovidgoyal
Copy link
Owner

assuming your simplification has the same performance and semantics, sure.

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