Templates: better post-header whitespace handling