#!/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\
: loop
n
/^\.$/b done1
p
b loop
: done1
a\
\
.
b
}
/d$/{
a\
i\
[DELETED]\
.
p
b
}
'; echo '1,$p') | ed - $1 | perl -e '
$buf = join("", );
$buf =~ s/pre>\s+\s+<\/pre/font><\/pre/g;
print $buf;
'