For empty / whitespace-only headings, output <p> instead of <h#>

Authored by Catrope.

Description

For empty / whitespace-only headings, output <p> instead of <h#>

Because sending HTML like <h2> </h2> or <h2></h2> to Parsoid
produces undesirable output like == == or ==<nowiki />==

Bug: T51452
Bug: T52100
Bug: T57769
Bug: T61647
Change-Id: If15a1b4b31d4f08c23ecdf2ecf61a8a14a77259a