html: switch the parse_node structure to a 'while (read) switch (type)' loop