If you started with an underline-based Markdown heading, then end up switching to an HTML heading, it's possible to forget to remove the underline (fantasai and I just did so). The Markdown processor then sees it as a normal markdown heading, and emits a confusing error message.
I should detect if the content of a markdown heading is actually a heading element. Probably just check if the end of the text is a heading end tag. Doesn't need to be robust, just a reasonable catch.