1
1
mirror of https://github.com/wez/wezterm.git synced 2024-08-16 17:50:28 +03:00

Fixes #4035: Make hyperlink rule match links that contain emojis

The other hyperlink rules (for links in brackets, etc.) have a lot of redundancy and actually use a simpler version of the link detection regex.

I haven’t updated those as making the regular expressions consistent should ideally be a separate issue and pull request.
This commit is contained in:
Aral Balkan 2023-07-21 12:05:53 +01:00 committed by GitHub
parent 94ab049637
commit adf7798b0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1622,7 +1622,7 @@ pub fn default_hyperlink_rules() -> Vec<hyperlink::Rule> {
hyperlink::Rule::with_highlight(r"<(\w+://\S+)>", "$1", 1).unwrap(),
// Then handle URLs not wrapped in brackets
// and include terminating ), / or - characters, if any
hyperlink::Rule::new(r"\b\w+://\S+[)/a-zA-Z0-9-]+", "$0").unwrap(),
hyperlink::Rule::new(r"\b\w+://\S+[)/a-zA-Z0-9-]+?(?=[\s]|$)", "$0").unwrap(),
// implicit mailto link
hyperlink::Rule::new(r"\b\w+@[\w-]+(\.[\w-]+)+\b", "mailto:$0").unwrap(),
]