startTagHeading method

void startTagHeading(
  1. StartTagToken token
)

Implementation

void startTagHeading(StartTagToken token) {
  if (tree.elementInScope('p', variant: 'button')) {
    endTagP(EndTagToken('p'));
  }
  if (headingElements.contains(tree.openElements.last.localName)) {
    parser
        .parseError(token.span, 'unexpected-start-tag', {'name': token.name});
    tree.openElements.removeLast();
  }
  tree.insertElement(token);
}