@Test public void shouldReturnFalseIfThereIsNoHtmlTag() { String test = "this is plain text"; assertThat(StringTools.noContentInHtml(test), equalTo(false)); }
public static boolean noContentInHtml(String text) { if (StringUtils.isBlank(text)) { return true; } try { Document doc = Jsoup.parse(text); String bodyText = doc.body().text(); return StringUtils.isBlank(bodyText); } catch (Exception ex) { return false; } }
StringTools { public static boolean noContentInHtml(String text) { if (StringUtils.isBlank(text)) { return true; } try { Document doc = Jsoup.parse(text); String bodyText = doc.body().text(); return StringUtils.isBlank(bodyText); } catch (Exception ex) { return false; } } }
StringTools { public static boolean noContentInHtml(String text) { if (StringUtils.isBlank(text)) { return true; } try { Document doc = Jsoup.parse(text); String bodyText = doc.body().text(); return StringUtils.isBlank(bodyText); } catch (Exception ex) { return false; } }  }
StringTools { public static boolean noContentInHtml(String text) { if (StringUtils.isBlank(text)) { return true; } try { Document doc = Jsoup.parse(text); String bodyText = doc.body().text(); return StringUtils.isBlank(bodyText); } catch (Exception ex) { return false; } }  static int getLevenshteinDistance(String str1, String str2); static Set<String> getApproximatelyMatchingStringList(String sourceString, String search); boolean isNotTooShort(String string); static Set<String> getApproximatelyMatchingStringList(String sourceString, String search, int maxDistance); static String getCompletingString(String string, int begin, int end); static List<MatchingWindow> getMatchingWindowsAboveThreshold(String text, String search, double threshold); static Set<String> splitIntoWordsWithLengthHigherThan(String string, int minLength); static Set<String> splitIntoWordsWithLengthHigherThan(String string, int minLength, String... ignoreWords); static boolean noContentInHtml(String text); static List<String> getRegexMatchesWithMinLength(String text, String regex, int minLength); static String getRandomForeName(); static String getRandomSurname(); static String getFirstHtmlWithContent(String html); static String getMetaDataFromHTML(String html); static String addMetaDataToHtml(String htmlText, String metaData); }
StringTools { public static boolean noContentInHtml(String text) { if (StringUtils.isBlank(text)) { return true; } try { Document doc = Jsoup.parse(text); String bodyText = doc.body().text(); return StringUtils.isBlank(bodyText); } catch (Exception ex) { return false; } }  static int getLevenshteinDistance(String str1, String str2); static Set<String> getApproximatelyMatchingStringList(String sourceString, String search); boolean isNotTooShort(String string); static Set<String> getApproximatelyMatchingStringList(String sourceString, String search, int maxDistance); static String getCompletingString(String string, int begin, int end); static List<MatchingWindow> getMatchingWindowsAboveThreshold(String text, String search, double threshold); static Set<String> splitIntoWordsWithLengthHigherThan(String string, int minLength); static Set<String> splitIntoWordsWithLengthHigherThan(String string, int minLength, String... ignoreWords); static boolean noContentInHtml(String text); static List<String> getRegexMatchesWithMinLength(String text, String regex, int minLength); static String getRandomForeName(); static String getRandomSurname(); static String getFirstHtmlWithContent(String html); static String getMetaDataFromHTML(String html); static String addMetaDataToHtml(String htmlText, String metaData);  }