# File : pretty
# Purpose : Reformat HTML to be more readable.
# Usage : pretty in-file out-file
# Comment : Rather crude, but better than nothing..
# Disclaimer: This software is provided freely on the understanding
# that the Author will not be held responsible for any
# problems arising from it's use, and that there is no
# support except by agreement on a fee for services.
# ________________________________________________________________
while (<>) {
s|\cM||g;
s|(^[^< ])| $1|; # Insert \t if not beginning <
s|^<(..)>([^\t])|<$1> $2|; # Put \t after margin markup
s|\, |,\n |g; # Put newline after comma
s|\. |.\n |g; # Put newline after period
s|\; |;\n |g; # Put newline after semicolon
s||\n
\n |g; # Move P from eol to start
s|
|\n
\n |g; # Move P from eol to start
s|||g; # Lower-case anchor
s|||g; # Lower-case hrule
s| <|\n <|g; # Make markup be at start
s| \(|\n (|g; # Make open bracket be at start
print ;
}