Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–243 unchanged (243 lines)
244 @param bodyHtml HTML to test
245 @param whitelist whitelist to test against
246 @return true if no tags or attributes were removed; false otherwise
247 @see #clean(String, org.jsoup.safety.Whitelist)
248 */
249 public static boolean isValid(String bodyHtml, Whitelist whitelist) {
250 return new Cleaner(whitelist).isValid(parseBodyFragment(bodyHtml, ""));
251 }
252
253}
254

After

…lines 1–243 unchanged (243 lines)
244 @param bodyHtml HTML to test
245 @param whitelist whitelist to test against
246 @return true if no tags or attributes were removed; false otherwise
247 @see #clean(String, org.jsoup.safety.Whitelist)
248 */
249 public static boolean isValid(String bodyHtml, Whitelist whitelist) {
250 return new Cleaner(whitelist).isValidBodyHtml(bodyHtml);
251 }
252
253}
254

Before

program
package_declaration
package "package"
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
identifier "Document"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "parser"
. "."
identifier "Parser"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "safety"
. "."
identifier "Cleaner"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "safety"
. "."
identifier "Whitelist"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "helper"
. "."
identifier "DataUtil"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "helper"
. "."
identifier "HttpConnection"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "File"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "IOException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "InputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "net"
. "."
identifier "URL"
; ";"
block_comment "/**\n The core public access point to the jsoup functionality"...
class_declaration
modifiers
public "public"
class "class"
identifier "Jsoup"
class_body
{ "{"
constructor_declaration
modifiers
private "private"
identifier "Jsoup"
formal_parameters
( "("
) ")"
constructor_body
{ "{"
} "}"
block_comment "/**\n Parse HTML into a Document. The parser will make a "...
method_declaration (+32 nodes collapsed)
block_comment "/**\n Parse HTML into a Document, using the provided Pars"...
method_declaration (+36 nodes collapsed)
block_comment "/**\n Parse HTML into a Document. As no base URI is speci"...
method_declaration (+30 nodes collapsed)
block_comment "/**\n * Creates a new {@link Connection} to a URL. Use to"...
method_declaration (+26 nodes collapsed)
block_comment "/**\n Parse the contents of a file as HTML.\n\n @param "...
method_declaration (+41 nodes collapsed)
block_comment "/**\n Parse the contents of a file as HTML. The location "...
method_declaration (+43 nodes collapsed)
block_comment "/**\n Read an input stream, and parse it to a Document.\n\n"...
method_declaration (+41 nodes collapsed)
block_comment "/**\n Read an input stream, and parse it to a Document. Y"...
method_declaration (+47 nodes collapsed)
block_comment "/**\n Parse a fragment of HTML, with the assumption that "...
method_declaration (+32 nodes collapsed)
block_comment "/**\n Parse a fragment of HTML, with the assumption that "...
method_declaration (+30 nodes collapsed)
block_comment "/**\n Fetch a URL, and parse it as HTML. Provided for com"...
method_declaration (+57 nodes collapsed)
block_comment "/**\n Get safe HTML from untrusted input HTML, by parsing"...
method_declaration (+80 nodes collapsed)
block_comment "/**\n Get safe HTML from untrusted input HTML, by parsing"...
method_declaration (+34 nodes collapsed)
block_comment "/**\n * Get safe HTML from untrusted input HTML, by parsi"...
method_declaration (+97 nodes collapsed)
block_comment "/**\n Test if the input body HTML has only tags and attri"...
method_declaration
modifiers
public "public"
static "static"
boolean_type "boolean"
identifier "isValid"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "bodyHtml"
, ","
formal_parameter
type_identifier "Whitelist"
identifier "whitelist"
) ")"
block
{ "{"
return_statement
return "return"
method_invocation
object_creation_expression
new "new"
type_identifier "Cleaner"
argument_list
( "("
identifier "whitelist"
) ")"
. "."
identifier "isValid"
argument_list
( "("
method_invocation
identifier "parseBodyFragment"
argument_list
( "("
identifier "bodyHtml"
, ","
string_literal
" "\""
" "\""
) ")"
) ")"
; ";"
} "}"
} "}"

After

program
package_declaration
package "package"
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
identifier "Document"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "parser"
. "."
identifier "Parser"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "safety"
. "."
identifier "Cleaner"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "safety"
. "."
identifier "Whitelist"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "helper"
. "."
identifier "DataUtil"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "helper"
. "."
identifier "HttpConnection"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "File"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "IOException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "InputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "net"
. "."
identifier "URL"
; ";"
block_comment "/**\n The core public access point to the jsoup functionality"...
class_declaration
modifiers
public "public"
class "class"
identifier "Jsoup"
class_body
{ "{"
constructor_declaration
modifiers
private "private"
identifier "Jsoup"
formal_parameters
( "("
) ")"
constructor_body
{ "{"
} "}"
block_comment "/**\n Parse HTML into a Document. The parser will make a "...
method_declaration (+32 nodes collapsed)
block_comment "/**\n Parse HTML into a Document, using the provided Pars"...
method_declaration (+36 nodes collapsed)
block_comment "/**\n Parse HTML into a Document. As no base URI is speci"...
method_declaration (+30 nodes collapsed)
block_comment "/**\n * Creates a new {@link Connection} to a URL. Use to"...
method_declaration (+26 nodes collapsed)
block_comment "/**\n Parse the contents of a file as HTML.\n\n @param "...
method_declaration (+41 nodes collapsed)
block_comment "/**\n Parse the contents of a file as HTML. The location "...
method_declaration (+43 nodes collapsed)
block_comment "/**\n Read an input stream, and parse it to a Document.\n\n"...
method_declaration (+41 nodes collapsed)
block_comment "/**\n Read an input stream, and parse it to a Document. Y"...
method_declaration (+47 nodes collapsed)
block_comment "/**\n Parse a fragment of HTML, with the assumption that "...
method_declaration (+32 nodes collapsed)
block_comment "/**\n Parse a fragment of HTML, with the assumption that "...
method_declaration (+30 nodes collapsed)
block_comment "/**\n Fetch a URL, and parse it as HTML. Provided for com"...
method_declaration (+57 nodes collapsed)
block_comment "/**\n Get safe HTML from untrusted input HTML, by parsing"...
method_declaration (+80 nodes collapsed)
block_comment "/**\n Get safe HTML from untrusted input HTML, by parsing"...
method_declaration (+34 nodes collapsed)
block_comment "/**\n * Get safe HTML from untrusted input HTML, by parsi"...
method_declaration (+97 nodes collapsed)
block_comment "/**\n Test if the input body HTML has only tags and attri"...
method_declaration
modifiers
public "public"
static "static"
boolean_type "boolean"
identifier "isValid"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "bodyHtml"
, ","
formal_parameter
type_identifier "Whitelist"
identifier "whitelist"
) ")"
block
{ "{"
return_statement
return "return"
method_invocation
object_creation_expression
new "new"
type_identifier "Cleaner"
argument_list
( "("
identifier "whitelist"
) ")"
. "."
identifier "isValidBodyHtml"
argument_list
( "("
identifier "bodyHtml"
) ")"
; ";"
} "}"
} "}"