def METHOD_NAME(self, tag) -> None:
    if not self._tag_queue:
        _warn(f"Closing '{tag}' at line {self._line_count} is missing an opening tag.")
    else:
        opening_tag, opening_tag_line = self._tag_queue.pop()
        if opening_tag != tag:
            _warn(
                f"Opening tag '{opening_tag}' at line {opening_tag_line} has no matching closing tag '{tag}' at line {self._line_count}."
            )
    if tag in ["head", "body", "html"]:
        return
    if self.taipy_tag is not None:
        self.parse_taipy_tag()
    if not self.is_body:
        self.head.append(self.head_tag)
        self.head_tag = None
    elif tag in self.tag_mapping:
        self.append_data(f"</{self.tag_mapping[tag]}>")
    else:
        self.append_data(f"</{tag}>")