Fix generation of url regex for Go

This commit is contained in:
Kovid Goyal
2023-03-09 18:59:09 +05:30
parent 2aa9187428
commit 0e5ed29d83
7 changed files with 38 additions and 19 deletions

View File

@@ -53,7 +53,7 @@ func process_escape_codes(text string) (ans string, hyperlinks []Mark) {
idx++
}
ans = utils.ReplaceAll(utils.MustCompile("\x1b(?:\\[[0-9;:]*?m|\\].*?\x1b\\)"), text, func(raw string, groupdict map[string]utils.SubMatch) string {
ans = utils.ReplaceAll(utils.MustCompile("\x1b(?:\\[[0-9;:]*?m|\\].*?\x1b\\\\)"), text, func(raw string, groupdict map[string]utils.SubMatch) string {
if !strings.HasPrefix(raw, "\x1b]8") {
removed_size += len(raw)
return ""