Apply anchor links more conservatively

Adding them to ALL the headings caused some unfortunate side-effects in
the top header. This commit ensures that they'll only be applied to
H1-H4s within the #content section.