added support for / in headings, minor tweaks

I added a / to index.php, meaning they can now feature in headings and
still be processed correctly.

I also made minor tweaks in an attempt to fix the markdown on 31.2 not
being processed in the P4 section.