private static boolean endsWithHtmlBlockTag(String text) {
    text = text.stripTrailing();
    if (text.isEmpty() || text.charAt(text.length() - 1) != '>') return false;
    String maybeBlockTag = text.substring(text.lastIndexOf('<') + 1, text.length() - 1);
    String trimmed = StringUtil.trim(maybeBlockTag.strip(), ch -> NOT_WHITESPACE_FILTER.accept(ch) && ch != '/');
    return HtmlUtil.isHtmlBlockTag(trimmed, false) || "br".equalsIgnoreCase(trimmed);
  }
private static boolean endsWithHtmlBlockTag(String text)