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

Adjust hyperlink rules to handle links containing ")" appropriately (#3803)

This commit is contained in:
Yasuharu Nakano 2023-08-28 12:11:49 +09:00
parent 115e629ec1
commit f674fdd12b
2 changed files with 4 additions and 3 deletions

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::with_highlight(r"[^(]\b(\w+://\S+[)/a-zA-Z0-9-]+)", "$1", 1).unwrap(),
// implicit mailto link
hyperlink::Rule::new(r"\b\w+@[\w-]+(\.[\w-]+)+\b", "mailto:$0").unwrap(),
]

View File

@ -68,8 +68,9 @@ config.hyperlink_rules = {
},
-- Then handle URLs not wrapped in brackets
{
regex = '\\b\\w+://\\S+[)/a-zA-Z0-9-]+',
format = '$0',
regex = '[^(]\\b(\\w+://\\S+[)/a-zA-Z0-9-]+)',
format = '$1',
highlight = 1,
},
-- implicit mailto link
{