Process: While using VE to edit, I've opened a template and copied some wikitext inside of it. I've pasting it where I needed to. It has been converted and I've then saved the page.
May be related to T145211: Headings occasionally serialised as <h2> elements rather than \n\n== Foo ==\n in Parsoid. Config: Firefox 48 on Xubuntu 16.04 LTS.