Linkify HTML headers and generate a TOC.