if (endHTMLEncountered) return;
if (shouldInsert()) {
    public void handleEndTag(HTML.Tag t, int pos)    {      // Don't call the Action if we've already seen </html>.      if (endHTMLEncountered)        return;            // If this is the </html> tag we need to stop calling the Actions      if (t == HTML.Tag.HTML)        endHTMLEncountered = true;            TagAction action = (TagAction) tagToAction.get(t);      if (action != null)        action.end(t);    }