Valid html output

Make the pre-html format output valid HTML.

This hasn't been tested at all. \o/