html: split out next_node from read (tree construction)