endTagListItem method

void endTagListItem(
  1. EndTagToken token
)

Implementation

void endTagListItem(EndTagToken token) {
  String? variant;
  if (token.name == 'li') {
    variant = 'list';
  } else {
    variant = null;
  }
  if (!tree.elementInScope(token.name, variant: variant)) {
    parser.parseError(token.span, 'unexpected-end-tag', {'name': token.name});
  } else {
    tree.generateImpliedEndTags(token.name);
    if (tree.openElements.last.localName != token.name) {
      parser
          .parseError(token.span, 'end-tag-too-early', {'name': token.name});
    }
    popOpenElementsUntil(token);
  }
}