Refactor second half of HTMLBuilder.tag().