## gawk -f cutSpace.awk <input.html> > <output.html>
BEGIN { IGNORECASE = 1
}
{
if (!pre)
sub(/^[ \t]+/, "")
sub(/[ \t]+$/, "")
if (match($0, "</pre>")) pre = 0
nl = pre ? "<br>" : " "
if (match($0, "<pre")) pre = 1
if ("" != $0) {
printf "%s%s", $0, nl
print $0 > "/dev/stderr"
}
}