File tree Expand file tree Collapse file tree 1 file changed +41
-1
lines changed Expand file tree Collapse file tree 1 file changed +41
-1
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,47 @@ if is_windows then
73
73
dev_domain = sshmux_domain
74
74
end
75
75
76
- local config = {}
76
+ local config = wezterm .config_builder ()
77
+
78
+ -- [default hyperlink_rules is wrong for Markdown link format · Issue #3803 · wezterm/wezterm](https://github.com/wezterm/wezterm/issues/3803)
79
+ config .hyperlink_rules = {
80
+ -- Matches: a URL in parens: (URL)
81
+ -- Markdown: [text](URL title)
82
+ {
83
+ regex = ' \\ ((\\ w+://[^\\ s\\ )]+)(?:\\ s+[^\\ )]*)?\\ )' ,
84
+ format = ' $1' ,
85
+ highlight = 1 ,
86
+ },
87
+ -- Matches: a URL in brackets: [URL]
88
+ {
89
+ regex = ' \\ [(\\ w+://\\ S+?)\\ ]' ,
90
+ format = ' $1' ,
91
+ highlight = 1 ,
92
+ },
93
+ -- Matches: a URL in curly braces: {URL}
94
+ {
95
+ regex = ' \\ {(\\ w+://\\ S+?)\\ }' ,
96
+ format = ' $1' ,
97
+ highlight = 1 ,
98
+ },
99
+ -- Matches: a URL in angle brackets: <URL>
100
+ {
101
+ regex = ' <(\\ w+://\\ S+?)>' ,
102
+ format = ' $1' ,
103
+ highlight = 1 ,
104
+ },
105
+ -- Then handle URLs not wrapped in brackets
106
+ -- regex = '\\b\\w+://\\S+[)/a-zA-Z0-9-]+',
107
+ {
108
+ regex = ' (?<![\\ (\\ {\\ [<])\\ b\\ w+://\\ S+' ,
109
+ format = ' $0' ,
110
+ },
111
+ -- implicit mailto link
112
+ {
113
+ regex = ' \\ b\\ w+@[\\ w-]+(\\ .[\\ w-]+)+\\ b' ,
114
+ format = ' mailto:$0' ,
115
+ },
116
+ }
77
117
78
118
config .tls_clients = {}
79
119
You can’t perform that action at this time.
0 commit comments