@Override
    public @NotNull TokenEmitter selfClosingTag(final @NotNull String token) {
      this.completeTag();
      this.consumer.append(TokenParser.TAG_START);
      this.escapeTagContent(token, QuotingOverride.UNQUOTED);
      this.tagState = TagState.MID_SELF_CLOSING;
      return this;
    }
mark tag boundaries within the stack, without needing to mess with typing too much.
text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/MiniMessageSerializer.java