@Test public void testRemoveComments() { logger.info("removeComments"); String text = "some text and <!-- \n these \n are \n comments --> nothing else"; String expResult = "some text and nothing else"; String result = HTMLParser.removeComments(text); assertEquals(expResult, result); }
public static String removeComments(String html) { return html.replaceAll("(?s)<!--.*?-->", ""); }
HTMLParser { public static String removeComments(String html) { return html.replaceAll("(?s)<!--.*?-->", ""); } }
HTMLParser { public static String removeComments(String html) { return html.replaceAll("(?s)<!--.*?-->", ""); }  }
HTMLParser { public static String removeComments(String html) { return html.replaceAll("(?s)<!--.*?-->", ""); }  static String replaceImgWithAlt(String html); static String removeComments(String html); static String unsafeRemoveAllTags(String html); static String safeRemoveAllTags(String html); static String removeNonTextTagsAndAttributes(String html); static String extractText(String html); static String extractTitle(String html); static Map<HyperlinkPart, List<String>> extractHyperlinks(String html); static Map<String, String> extractMetatags(String html); static Map<String, List<String>> extractHTMLheaders(String html); }
HTMLParser { public static String removeComments(String html) { return html.replaceAll("(?s)<!--.*?-->", ""); }  static String replaceImgWithAlt(String html); static String removeComments(String html); static String unsafeRemoveAllTags(String html); static String safeRemoveAllTags(String html); static String removeNonTextTagsAndAttributes(String html); static String extractText(String html); static String extractTitle(String html); static Map<HyperlinkPart, List<String>> extractHyperlinks(String html); static Map<String, String> extractMetatags(String html); static Map<String, List<String>> extractHTMLheaders(String html);  }