It appears that pandoc 2 is converting <!doctype> to <!doctype> when converting from .md to .html. The downstream consequence is that html and html-to-pdf output now have <!doctype> at the head.
On a personal note, your package is very much appreciated.