1
0
Fork 0
postfix/mantools/hchangered
Daniel Baumann 75cf244379
Adding upstream version 3.10.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-21 14:19:32 +02:00

40 lines
640 B
Bash
Executable file

#!/bin/sh
# Usage: hchangered oldfile newfile
# hchangered - crude tool to red-color changes in HTML text. Text is
# also underlined so it shows on monochrome printers.
# Bugs: does not red-color text inside tables. Fascist software may
# complain about tags being out of order.
diff -e $1 $2 | (sed -n -e '
/[ac]$/{
p
a\
<font color="red"><u>
: loop
n
/^\.$/b done1
p
b loop
: done1
a\
</u></font>\
.
b
}
/d$/{
a\
i\
<font color="red"><u>[DELETED]</u></font>\
.
p
b
}
'; echo '1,$p') | ed - $1 | perl -e '
$buf = join("", <STDIN>);
$buf =~ s/pre>\s+<font/pre><font/g;
$buf =~ s/font>\s+<\/pre/font><\/pre/g;
print $buf;
'