Document.parseErrors

ParseError[] parseErrors() @property

The parse errors, in the order of the input (it completes the parsing). They are collected only with ParseOptions.collectErrors, else the list is empty. The errors of the tree construction are at the end of the token that causes them.

ParseOptions options = { collectErrors: true };
auto doc = Document("<p>unclosed <b>tags", options);
foreach (e; doc.parseErrors) writeln(e);    // 1:4: missing-doctype, 1:20: unclosed-element-at-eof