test_class.file: collect_app/src/test/java/org/odk/collect/android/utilities/TextUtilsTest.java
test_class.identifier: TextUtilsTest
test_case.body: @Test
      public void ellipsizeBeginningTest() {
          //50 chars
          assertEquals("Lorem ipsum dolor sit amet, consectetur massa nunc",
                  TextUtils.ellipsizeBeginning("Lorem ipsum dolor sit amet, consectetur massa nunc"));
          //100 chars
          assertEquals("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer tempus, risus ac cursus turpis duis",
                  TextUtils.ellipsizeBeginning("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer tempus, risus ac cursus turpis duis"));
          //101 chars
          assertEquals("...m ipsum dolor sit amet, consectetur adipiscing elit. Cras finibus, augue a imperdiet orci aliquam",
                  TextUtils.ellipsizeBeginning("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras finibus, augue a imperdiet orci aliquam"));
          //150 chars
          assertEquals("...it. Donec cursus condimentum sagittis. Ut condimentum efficitur libero, vitae volutpat dui nullam",
                  TextUtils.ellipsizeBeginning("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec cursus condimentum sagittis. Ut condimentum efficitur libero, vitae volutpat dui nullam"));
      }
test_case.class_method_signature: TextUtilsTest.ellipsizeBeginningTest()
test_case.full_signature: @Test public void ellipsizeBeginningTest()
test_case.identifier: ellipsizeBeginningTest
test_case.invocations: assertEquals ellipsizeBeginning assertEquals ellipsizeBeginning assertEquals ellipsizeBeginning assertEquals ellipsizeBeginning
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void ellipsizeBeginningTest()
focal_class.declarator: createHeader = new ReplaceCallback.Callback() {
          public String matchFound(MatchResult match) {
              int level = match.group(1).length();
              return "<h" + level + ">" + match.group(2).replaceAll("#+$", "").trim() + "</h" + level
                      + ">";
          }
      }
focal_class.modifier: private static
focal_class.original_string: private static ReplaceCallback.Callback createHeader = new ReplaceCallback.Callback() {
          public String matchFound(MatchResult match) {
              int level = match.group(1).length();
              return "<h" + level + ">" + match.group(2).replaceAll("#+$", "").trim() + "</h" + level
                      + ">";
          }
      };
focal_class.type: ReplaceCallback.Callback
focal_class.var_name: createHeader
focal_class.declarator: createParagraph = new ReplaceCallback.Callback() {
          public String matchFound(MatchResult match) {
              String trimmed = match.group(1).trim();
              if (trimmed.matches("(?i)^<\\/?(h|p|bl)")) {
                  return match.group(1);
              }
              return "<p>" + trimmed + "</p>";
          }
      }
focal_class.modifier: private static
focal_class.original_string: private static ReplaceCallback.Callback createParagraph = new ReplaceCallback.Callback() {
          public String matchFound(MatchResult match) {
              String trimmed = match.group(1).trim();
              if (trimmed.matches("(?i)^<\\/?(h|p|bl)")) {
                  return match.group(1);
              }
              return "<p>" + trimmed + "</p>";
          }
      };
focal_class.type: ReplaceCallback.Callback
focal_class.var_name: createParagraph
focal_class.declarator: createSpan = new ReplaceCallback.Callback() {
          public String matchFound(MatchResult match) {
              String attributes = sanitizeAttributes(match.group(1));
              return "<font" + attributes + ">" + match.group(2).trim() + "</font>";
          }
  
          // throw away all styles except for color and font-family
          private String sanitizeAttributes(String attributes) {
  
              String stylesText = attributes.replaceAll("style=[\"'](.*?)[\"']", "$1");
              String[] styles = stylesText.trim().split(";");
              StringBuffer stylesOutput = new StringBuffer();
  
              for (String style : styles) {
                  String[] stylesAttributes = style.trim().split(":");
                  if (stylesAttributes[0].equals("color")) {
                      stylesOutput.append(" color=\"" + stylesAttributes[1] + "\"");
                  }
                  if (stylesAttributes[0].equals("font-family")) {
                      stylesOutput.append(" face=\"" + stylesAttributes[1] + "\"");
                  }
              }
  
              return stylesOutput.toString();
          }
      }
focal_class.modifier: private static
focal_class.original_string: private static ReplaceCallback.Callback createSpan = new ReplaceCallback.Callback() {
          public String matchFound(MatchResult match) {
              String attributes = sanitizeAttributes(match.group(1));
              return "<font" + attributes + ">" + match.group(2).trim() + "</font>";
          }
  
          // throw away all styles except for color and font-family
          private String sanitizeAttributes(String attributes) {
  
              String stylesText = attributes.replaceAll("style=[\"'](.*?)[\"']", "$1");
              String[] styles = stylesText.trim().split(";");
              StringBuffer stylesOutput = new StringBuffer();
  
              for (String style : styles) {
                  String[] stylesAttributes = style.trim().split(":");
                  if (stylesAttributes[0].equals("color")) {
                      stylesOutput.append(" color=\"" + stylesAttributes[1] + "\"");
                  }
                  if (stylesAttributes[0].equals("font-family")) {
                      stylesOutput.append(" face=\"" + stylesAttributes[1] + "\"");
                  }
              }
  
              return stylesOutput.toString();
          }
      };
focal_class.type: ReplaceCallback.Callback
focal_class.var_name: createSpan
focal_class.file: collect_app/src/main/java/org/odk/collect/android/utilities/TextUtils.java
focal_class.identifier: TextUtils
focal_class.class_method_signature: TextUtils.TextUtils()
focal_class.full_signature: private  TextUtils()
focal_class.identifier: TextUtils
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  TextUtils()
focal_class.class_method_signature: TextUtils.markdownToHtml(String text)
focal_class.full_signature: protected static String markdownToHtml(String text)
focal_class.identifier: markdownToHtml
focal_class.modifiers: protected static
focal_class.parameters: (String text)
focal_class.return: String
focal_class.signature: String markdownToHtml(String text)
focal_class.class_method_signature: TextUtils.textToHtml(String text)
focal_class.full_signature: public static CharSequence textToHtml(String text)
focal_class.identifier: textToHtml
focal_class.modifiers: public static
focal_class.parameters: (String text)
focal_class.return: CharSequence
focal_class.signature: CharSequence textToHtml(String text)
focal_class.class_method_signature: TextUtils.ellipsizeBeginning(String text)
focal_class.full_signature: public static String ellipsizeBeginning(String text)
focal_class.identifier: ellipsizeBeginning
focal_class.modifiers: public static
focal_class.parameters: (String text)
focal_class.return: String
focal_class.signature: String ellipsizeBeginning(String text)
focal_class.class_method_signature: TextUtils.join(@NonNull CharSequence delimiter, @NonNull Iterable tokens)
focal_class.full_signature: public static String join(@NonNull CharSequence delimiter, @NonNull Iterable tokens)
focal_class.identifier: join
focal_class.modifiers: public static
focal_class.parameters: (@NonNull CharSequence delimiter, @NonNull Iterable tokens)
focal_class.return: String
focal_class.signature: String join(@NonNull CharSequence delimiter, @NonNull Iterable tokens)
focal_method.body: public static String ellipsizeBeginning(String text) {
          return text.length() <= 100
                  ? text
                  : "..." + text.substring(text.length() - 97, text.length());
      }
focal_method.class_method_signature: TextUtils.ellipsizeBeginning(String text)
focal_method.full_signature: public static String ellipsizeBeginning(String text)
focal_method.identifier: ellipsizeBeginning
focal_method.invocations: length substring length length
focal_method.modifiers: public static
focal_method.parameters: (String text)
focal_method.return: String
focal_method.signature: String ellipsizeBeginning(String text)