The current parse for SGML comments will match from <!-- to -->. That is slightly off. The end delimeter must allow whitespace between the hyphens and the right angle bracket.
So I would change line 1224 of DTD.pm from this:
if ($dtd =~ /^<!--.*?-->/s) {
To this:
if ($dtd =~ /^<!--.*?--\s*>/s) {
---