From 44af9271e0e984544762e2212549f134c86b4418 Mon Sep 17 00:00:00 2001 From: Alberto Fanjul Date: Mon, 6 Jun 2022 07:32:45 +0200 Subject: [PATCH] Turn ansi escape sequences into html tags --- scripts/w3mman/w3mman2html.cgi.in | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/w3mman/w3mman2html.cgi.in b/scripts/w3mman/w3mman2html.cgi.in index 2d326a9..71ad770 100644 --- a/scripts/w3mman/w3mman2html.cgi.in +++ b/scripts/w3mman/w3mman2html.cgi.in @@ -162,6 +162,16 @@ EOF next; } + my $printchar='[^]'; + s@\[34m\[1m($printchar+)\[0m@$1@g; + s@\[1m($printchar+)\[0m@$1@g; + s@\[4m($printchar+)\[24m@$1@g; + s@\[1m($printchar+)\[0m@$1@g; + s@\[1m($printchar+)\[22m@$1@g; + s@\[1m($printchar+)\[4m@$1@g; + s@\[22m($printchar+)\[0m@$1@g; + s@\[22m($printchar+)\[24m@$1@g; + s@\[4m($printchar+)\[0m@$1@g; s@(http|ftp)://[\w.\-/~]+[\w/]@$&@g; s@\b(mailto:|)(\w[\w.\-]*\@\w[\w.\-]*\.[\w.\-]*\w)@$1$2@g; s@(\W)(\~?/[\w.][\w.\-/~]*)@$1 . &file_ref($2)@ge;