@Test void escapeHTMLCharsInAttributes() throws Exception { String htmlInput = "<div foo=\"aaa&quot;bbb&amp;ccc&gt;ddd&lt;eee&apos;fff\">content</div>"; Document document = this.cleaner.clean(new StringReader(htmlInput)); String textContent = document.getElementsByTagName("div").item(0).getAttributes().getNamedItem("foo").getTextContent(); assertEquals("aaa\"bbb&ccc>ddd<eee'fff", textContent); htmlInput = "<div foo='aaa&quot;bbb&amp;ccc&gt;ddd&lt;eee&apos;fff'>content</div>"; document = this.cleaner.clean(new StringReader(htmlInput)); textContent = document.getElementsByTagName("div").item(0).getAttributes().getNamedItem("foo").getTextContent(); assertEquals("aaa\"bbb&ccc>ddd<eee'fff", textContent); assertHTML("<div foo=\"aaa&quot;bbb&amp;ccc&gt;ddd&lt;eee'fff\">content</div>", "<div foo=\"aaa&quot;bbb&amp;ccc&gt;ddd&lt;eee&apos;fff\">content</div>"); assertHTML("<div foo=\"aaa&quot;bbb&amp;ccc&gt;ddd&lt;eee'fff\">content</div>", "<div foo='aaa&quot;bbb&amp;ccc&gt;ddd&lt;eee&apos;fff'>content</div>"); }
@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();  }