colorize: handle mailto prefixes in urls

mailto:email@domain.tld is the only exception that does not use the
<scheme>:// prefix.

Requested-by: Moritz Poldrack <moritz@poldrack.dev>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Moritz Poldrack <moritz@poldrack.dev>
This commit is contained in:
Robin Jarry 2022-03-18 21:30:50 +01:00
parent 40d298b8d8
commit 807870ea35

View file

@ -23,7 +23,7 @@ BEGIN {
in_body = 0 in_body = 0
# patterns # patterns
header_pattern = @/^[A-Z][[:alnum:]-]+:/ header_pattern = @/^[A-Z][[:alnum:]-]+:/
url_pattern = @/[a-z]{2,6}:\/\/[[:graph:]]+|[[:alnum:]_\+\.~\/-]*[[:alnum:]_]@[[:lower:]][[:alnum:]\.-]*[[:lower:]]/ url_pattern = @/[a-z]{2,6}:\/\/[[:graph:]]+|(mailto:)?[[:alnum:]_\+\.~\/-]*[[:alnum:]_]@[[:lower:]][[:alnum:]\.-]*[[:lower:]]/
} }
function color_quote(line) { function color_quote(line) {
level = 0 level = 0