docs: private static String sanitizeText(String text) {
          if (text.indexOf('\r') >= 0) {
              text = CR.matcher(text).replaceAll("");
          }
          if (!text.isEmpty() && !text.endsWith("\n")) {
              text += "\n";
          }
          return text;
      }