@Test @Disabled("See https: public void parseWithUnicodeChars() throws Exception { CleanerProperties cleanerProperties = new CleanerProperties(); cleanerProperties.setDeserializeEntities(true); cleanerProperties.setRecognizeUnicodeChars(true); cleanerProperties.setTranslateSpecialEntities(false); HtmlCleaner cleaner = new HtmlCleaner(cleanerProperties); TagNode tagNode = cleaner.clean("<?xml version = \"1.0\"?>" + "<div foo=\"&#169;\">&#169;</div>" + "<div foo=\"baz&gt;buz\">baz&gt;buz</div>" + "<div foo=\"baz&buz\">baz&buz</div>"); List<? extends TagNode> divList = tagNode.getElementListByName("div", true); assertEquals(3, divList.size()); assertEquals("©", divList.get(0).getText().toString()); assertEquals("©", divList.get(0).getAttributeByName("foo")); assertEquals("baz>buz", divList.get(1).getText().toString()); assertEquals("baz>buz", divList.get(1).getAttributeByName("foo")); assertEquals("baz&buz", divList.get(2).getText().toString()); assertEquals("baz&buz", divList.get(2).getAttributeByName("foo")); DomSerializer domSerializer = new DomSerializer(cleanerProperties, false); Document document = domSerializer.createDOM(tagNode); NodeList nodeList = document.getElementsByTagName("div"); assertEquals(3, nodeList.getLength()); assertEquals("©", nodeList.item(0).getTextContent()); assertEquals("©", nodeList.item(0).getAttributes().getNamedItem("foo").getTextContent()); assertEquals("baz>buz", nodeList.item(1).getAttributes().getNamedItem("foo").getTextContent()); assertEquals("baz&buz", nodeList.item(2).getAttributes().getNamedItem("foo").getTextContent()); assertEquals("baz>buz", nodeList.item(1).getTextContent()); assertEquals("baz&buz", nodeList.item(2).getTextContent()); }
@Override public Document clean(Reader originalHtmlContent) { return clean(originalHtmlContent, getDefaultConfiguration()); }
DefaultHTMLCleaner implements HTMLCleaner { @Override public Document clean(Reader originalHtmlContent) { return clean(originalHtmlContent, getDefaultConfiguration()); } }
DefaultHTMLCleaner implements HTMLCleaner { @Override public Document clean(Reader originalHtmlContent) { return clean(originalHtmlContent, getDefaultConfiguration()); }  }
DefaultHTMLCleaner implements HTMLCleaner { @Override public Document clean(Reader originalHtmlContent) { return clean(originalHtmlContent, getDefaultConfiguration()); }  @Override Document clean(Reader originalHtmlContent); @Override Document clean(Reader originalHtmlContent, HTMLCleanerConfiguration configuration); @Override HTMLCleanerConfiguration getDefaultConfiguration(); }
DefaultHTMLCleaner implements HTMLCleaner { @Override public Document clean(Reader originalHtmlContent) { return clean(originalHtmlContent, getDefaultConfiguration()); }  @Override Document clean(Reader originalHtmlContent); @Override Document clean(Reader originalHtmlContent, HTMLCleanerConfiguration configuration); @Override HTMLCleanerConfiguration getDefaultConfiguration();  }