src/main/java/org/jsoup/safety/Cleaner.java
/**
     Creates a new, clean document, from the original dirty document, containing only elements allowed by the safelist.
     The original document is not modified. Only elements from the dirty document's <code>body</code> are used. The
     OutputSettings of the original document are cloned into the clean document.
     @param dirtyDocument Untrusted base document to clean.
     @return cleaned document.
     */
Creates a new, clean document, from the original dirty document, containing only elements allowed by the safelist.
The original document is not modified. Only elements from the dirty document's body are used. The
OutputSettings of the original document are cloned into the clean document.
Creates a new clean document from the original dirty document containing only elements allowed by the safelist . The original document is not modified . Only elements from the dirty document ' s body are used . The OutputSettings of the original document are cloned into the clean document .
public Document clean(Document dirtyDocument) {
        Validate.notNull(dirtyDocument);
        Document clean = Document.createShell(dirtyDocument.baseUri());
        copySafeNodes(dirtyDocument.body(), clean.body());
        clean.outputSettings(dirtyDocument.outputSettings().clone());
        return clean;
    }
public Document clean ( Document dirtyDocument ) { Validate . notNull ( dirtyDocument ) ; Document clean = Document . createShell ( dirtyDocument . baseUri ( ) ) ; copySafeNodes ( dirtyDocument . body ( ) , clean . body ( ) ) ; clean . outputSettings ( dirtyDocument . outputSettings ( ) . clone ( ) ) ; return clean ; }
Creates a new, clean document, from the original dirty document, containing only elements allowed by the safelist.
Creates a new clean document from the original dirty document containing only elements allowed by the safelist .