@Test public void simpleBehaviourTest() { String h = "<div><p class=foo><a href='http: String cleanHtml = Jsoup.clean(h, Whitelist.simpleText()); assertEquals("Hello <b>there</b>!", TextUtil.stripNewlines(cleanHtml)); }
public Document clean(Document dirtyDocument) { Validate.notNull(dirtyDocument); Document clean = Document.createShell(dirtyDocument.baseUri()); if (dirtyDocument.body() != null) copySafeNodes(dirtyDocument.body(), clean.body()); return clean; }
Cleaner { public Document clean(Document dirtyDocument) { Validate.notNull(dirtyDocument); Document clean = Document.createShell(dirtyDocument.baseUri()); if (dirtyDocument.body() != null) copySafeNodes(dirtyDocument.body(), clean.body()); return clean; } }
Cleaner { public Document clean(Document dirtyDocument) { Validate.notNull(dirtyDocument); Document clean = Document.createShell(dirtyDocument.baseUri()); if (dirtyDocument.body() != null) copySafeNodes(dirtyDocument.body(), clean.body()); return clean; } Cleaner(Whitelist whitelist); }
Cleaner { public Document clean(Document dirtyDocument) { Validate.notNull(dirtyDocument); Document clean = Document.createShell(dirtyDocument.baseUri()); if (dirtyDocument.body() != null) copySafeNodes(dirtyDocument.body(), clean.body()); return clean; } Cleaner(Whitelist whitelist); Document clean(Document dirtyDocument); boolean isValid(Document dirtyDocument); }
Cleaner { public Document clean(Document dirtyDocument) { Validate.notNull(dirtyDocument); Document clean = Document.createShell(dirtyDocument.baseUri()); if (dirtyDocument.body() != null) copySafeNodes(dirtyDocument.body(), clean.body()); return clean; } Cleaner(Whitelist whitelist); Document clean(Document dirtyDocument); boolean isValid(Document dirtyDocument);  }