try {
while ((cursor = lexer.nextNode()) != null) {
if (cursor instanceof Remark) {
items.add(new SimpleComment(cursor.getText()));
} else if (cursor instanceof Text) {
items.add(new SimpleText(cursor.toHtml()));
} else if (cursor instanceof org.htmlparser.Tag) {
processTag(nodes, current, items, (org.htmlparser.Tag) cursor);
} else {
throw new BrixException("Unknown node type " + cursor.getClass().getName());
}