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

Issue: Plain "www." prefixed URLs are not detected or clickable. #12

Closed
jtbrown3 opened this issue Jul 7, 2022 · 2 comments
Closed
Labels
enhancement New feature or request

Comments

@jtbrown3
Copy link

jtbrown3 commented Jul 7, 2022

Hello, Thx for publishing this excellent plugin/package for Sublime Text!
Unfortunately, the plugin/package is currently not detecting URLs prefixed with only "www." (whereas right-clicking in Sublime Text 3/4 DOES detect plain "www" links)

For example, OpenUri will not detect simple links like:

The above links are all detected properly by default when right-clicked within Sublime Text.

Is there any way you could add the capability to detect www links? (this would make provide consistency with the existing functionality within ST 3/4)

Thanks for considering! -JT

@jfcherng
Copy link
Member

jfcherng commented Jul 7, 2022

rex = re.compile(
    r'''(?x)
    \b(?:
        https?://(?:(?:[\w\d\-]+(?:\.[\w\d\-.]+)+)|localhost)|  # http://
        www\.[\w\d\-]+(?:\.[\w\d\-.]+)+                         # www.
    )
    /?[\w\d\-.?,!'(){}\[\]/+&@%$#=:"|~;]*                       # url path and query string
    [\w\d\-~:/#@$*+=]                                           # allowed end chars
    ''')

Yes, so ST treats "www" without a scheme as a special case.


Added in b1cfb1e and released as v7.2.0.

@jfcherng jfcherng closed this as completed Jul 7, 2022
@jfcherng jfcherng added the enhancement New feature or request label Jul 7, 2022
@jtbrown3
Copy link
Author

jtbrown3 commented Jul 7, 2022

Wow!
Thank you Jack @jfcherng for the amazingly fast enhancement/turnaround on this!
I've already tested and it works great!
Blessings! -JT 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants