docs: public BidiWrappingText spanWrappingText(@Nullable Dir dir, String str, boolean isHtml) {
      if (dir == null) {
        dir = estimateDirection(str, isHtml);
      }
  
      StringBuilder beforeText = new StringBuilder();
      StringBuilder afterText = new StringBuilder();
      boolean dirCondition = (dir != Dir.NEUTRAL && dir != contextDir);
      if (dirCondition) {
        beforeText.append("<span dir=\"").append(dir == Dir.RTL ? "rtl" : "ltr").append("\">");
        afterText.append("</span>");
      }
      afterText.append(markAfter(dir, str, isHtml));
      return BidiWrappingText.create(beforeText.toString(), afterText.toString());
    }