code: function addParserEvents(parser) {
    parser.onopentag = parser_opentag;
    parser.onclosetag = parser_closetag;
    parser.ontext = parser_text;
    parser.oncdata = parser_cdata;
    parser.oncomment = parser_comment;
    parser.ondoctype = parser_doctype;
    parser.onerror = parser_error;
  }
docs: /*
  Helper functions