Fix crash bugs with & entities in <h1> tags
This review fixes an infinite loop when &-entities are found within an <h1>
tag.
- Bonus Semantic 0 vs. NULL vs. '\0' changes for readability.
- Reformat functions to be readable; spacing and missing braces.
- Sorry for the whitespace changes. It looks like it was 2-space indented so I stuck with that, but some of these lines were mixed tabs/spaces.
Edited by Andy Stamp