(question) HTML pretty printer

William Park opengeometry at yahoo.ca
Thu Dec 5 11:18:41 EST 2002


Dear HTML+Python experts,

I sometime have to deal with HTML file with messy indentation, long lines,
etc.  I would like to reformat the file with a decent indentation and line
length, by adding/removing whitespaces only.  I don't want any change to
HTML codes, like tag completion, reordering, error correction.

Is there Python script that re-formats HTML files?  The only solution I
know is
    lynx -preparsed -source http://...
but it only deals with line length, and doesn't do indentation.  I prefer
Python solution, because I can't always install binary as I please.

Google search for 'HTML+pretty+print' turns up nothing, though I think I've
seen this question time to time.

-- 
William Park, Open Geometry Consulting, <opengeometry at yahoo.ca>
Linux solution for data management and processing. 



More information about the Python-list mailing list