From d2c239292e2270b949faa67c8f91e99e2a59cc88 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Wed, 23 Feb 2022 22:34:41 +0100 Subject: [PATCH] filters: fix colorize urls in signatures When a signature contains a line that starts with an url, the url is not highlighted properly: -- Foobar [38;2;255;255;175mmhttps://foobar.org The trailing m of the signature color start \x1b[38;2;175;135;255m is considered as part of the URL scheme (i.e. mhttps:// instead of https://). Colorize the URLs first before wrapping with the signature color. Fixes: df8c129235d9 ("filters: port colorize to awk") Signed-off-by: Robin Jarry --- filters/colorize | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filters/colorize b/filters/colorize index 2e6001c..c0e25f1 100755 --- a/filters/colorize +++ b/filters/colorize @@ -77,8 +77,8 @@ function color_quote(line) { $0 = diff_del $0 reset } } else if (in_signature) { - $0 = signature $0 reset gsub(url_pattern, url "&" signature) + $0 = signature $0 reset } else if (in_headers) { if ($0 ~ /^$/) { in_signature = 0