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–126 unchanged (126 lines)
127 /**
128 * Utility method to unescape HTML entities from a string
129 * @param string HTML escaped string
130 * @param inAttribute if the string is to be escaped in strict mode (as attributes are)
131 * @return an unescaped string
132 */
133
134 /**
135 * @param bodyHtml HTML to parse
136 * @param baseUri baseUri base URI of document (i.e. original fetch location), for resolving relative URLs.
137 *
138 * @return parsed Document
139 * @deprecated Use {@link #parseBodyFragment} or {@link #parseFragment} instead.
…lines 140–165 unchanged (26 lines)

After

…lines 1–126 unchanged (126 lines)
127 /**
128 * Utility method to unescape HTML entities from a string
129 * @param string HTML escaped string
130 * @param inAttribute if the string is to be escaped in strict mode (as attributes are)
131 * @return an unescaped string
132 */
133 public static String unescapeEntities(String string, boolean inAttribute) {
134 Tokeniser tokeniser = new Tokeniser(new CharacterReader(string), ParseErrorList.noTracking());
135 return tokeniser.unescapeEntities(inAttribute);
136 }
137
138 /**
139 * @param bodyHtml HTML to parse
140 * @param baseUri baseUri base URI of document (i.e. original fetch location), for resolving relative URLs.
141 *
142 * @return parsed Document
…lines 143–169 unchanged (27 lines)

Before

program
package_declaration
package "package"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "parser"
; ";"
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 "nodes"
. "."
identifier "Element"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
identifier "Node"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
block_comment "/**\n * Parses HTML into a {@link org.jsoup.nodes.Document}. "...
class_declaration
modifiers
public "public"
class "class"
identifier "Parser"
class_body
{ "{"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "DEFAULT_MAX_ERRORS"
= "="
decimal_integer_literal "0"
; ";"
line_comment "// by default, error tracking is disabled."
field_declaration
modifiers
private "private"
type_identifier "TreeBuilder"
variable_declarator
identifier "treeBuilder"
; ";"
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "maxErrors"
= "="
identifier "DEFAULT_MAX_ERRORS"
; ";"
field_declaration
modifiers
private "private"
type_identifier "ParseErrorList"
variable_declarator
identifier "errors"
; ";"
block_comment "/**\n * Create a new Parser, using the specified TreeBuil"...
constructor_declaration (+22 nodes collapsed)
method_declaration (+68 nodes collapsed)
line_comment "// gets & sets"
block_comment "/**\n * Get the TreeBuilder currently in use.\n * @ret"...
method_declaration
modifiers
public "public"
type_identifier "TreeBuilder"
identifier "getTreeBuilder"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "treeBuilder"
; ";"
} "}"
block_comment "/**\n * Update the TreeBuilder used when parsing content."...
method_declaration (+27 nodes collapsed)
block_comment "/**\n * Check if parse error tracking is enabled.\n * "...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isTrackErrors"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
binary_expression
identifier "maxErrors"
> ">"
decimal_integer_literal "0"
; ";"
} "}"
block_comment "/**\n * Enable or disable parse error tracking for the ne"...
method_declaration (+28 nodes collapsed)
block_comment "/**\n * Retrieve the parse errors, if any, from the last "...
method_declaration
modifiers
public "public"
generic_type
type_identifier "List"
type_arguments
< "<"
type_identifier "ParseError"
> ">"
identifier "getErrors"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "errors"
; ";"
} "}"
line_comment "// static parse functions below"
block_comment "/**\n * Parse HTML into a Document.\n *\n * @param "...
method_declaration (+52 nodes collapsed)
block_comment "/**\n * Parse a fragment of HTML into a list of nodes. Th"...
method_declaration (+63 nodes collapsed)
block_comment "/**\n * Parse a fragment of HTML into the {@code body} of"...
method_declaration (+123 nodes collapsed)
block_comment "/**\n * Utility method to unescape HTML entities from a s"...
block_comment "/**\n * @param bodyHtml HTML to parse\n * @param baseU"...
method_declaration (+30 nodes collapsed)
line_comment "// builders"
block_comment "/**\n * Create a new HTML parser. This parser treats inpu"...
method_declaration (+27 nodes collapsed)
block_comment "/**\n * Create a new XML parser. This parser assumes no k"...
method_declaration (+27 nodes collapsed)
} "}"

After

program
package_declaration
package "package"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "parser"
; ";"
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 "nodes"
. "."
identifier "Element"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
identifier "Node"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
block_comment "/**\n * Parses HTML into a {@link org.jsoup.nodes.Document}. "...
class_declaration
modifiers
public "public"
class "class"
identifier "Parser"
class_body
{ "{"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "DEFAULT_MAX_ERRORS"
= "="
decimal_integer_literal "0"
; ";"
line_comment "// by default, error tracking is disabled."
field_declaration
modifiers
private "private"
type_identifier "TreeBuilder"
variable_declarator
identifier "treeBuilder"
; ";"
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "maxErrors"
= "="
identifier "DEFAULT_MAX_ERRORS"
; ";"
field_declaration
modifiers
private "private"
type_identifier "ParseErrorList"
variable_declarator
identifier "errors"
; ";"
block_comment "/**\n * Create a new Parser, using the specified TreeBuil"...
constructor_declaration (+22 nodes collapsed)
method_declaration (+68 nodes collapsed)
line_comment "// gets & sets"
block_comment "/**\n * Get the TreeBuilder currently in use.\n * @ret"...
method_declaration
modifiers
public "public"
type_identifier "TreeBuilder"
identifier "getTreeBuilder"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "treeBuilder"
; ";"
} "}"
block_comment "/**\n * Update the TreeBuilder used when parsing content."...
method_declaration (+27 nodes collapsed)
block_comment "/**\n * Check if parse error tracking is enabled.\n * "...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isTrackErrors"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
binary_expression
identifier "maxErrors"
> ">"
decimal_integer_literal "0"
; ";"
} "}"
block_comment "/**\n * Enable or disable parse error tracking for the ne"...
method_declaration (+28 nodes collapsed)
block_comment "/**\n * Retrieve the parse errors, if any, from the last "...
method_declaration
modifiers
public "public"
generic_type
type_identifier "List"
type_arguments
< "<"
type_identifier "ParseError"
> ">"
identifier "getErrors"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "errors"
; ";"
} "}"
line_comment "// static parse functions below"
block_comment "/**\n * Parse HTML into a Document.\n *\n * @param "...
method_declaration (+52 nodes collapsed)
block_comment "/**\n * Parse a fragment of HTML into a list of nodes. Th"...
method_declaration (+63 nodes collapsed)
block_comment "/**\n * Parse a fragment of HTML into the {@code body} of"...
method_declaration (+123 nodes collapsed)
block_comment "/**\n * Utility method to unescape HTML entities from a s"...
method_declaration
modifiers
public "public"
static "static"
type_identifier "String"
identifier "unescapeEntities"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "string"
, ","
formal_parameter
boolean_type "boolean"
identifier "inAttribute"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "Tokeniser"
variable_declarator
identifier "tokeniser"
= "="
object_creation_expression
new "new"
type_identifier "Tokeniser"
argument_list
( "("
object_creation_expression
new "new"
type_identifier "CharacterReader"
argument_list
( "("
identifier "string"
) ")"
, ","
method_invocation
identifier "ParseErrorList"
. "."
identifier "noTracking"
argument_list
( "("
) ")"
) ")"
; ";"
return_statement
return "return"
method_invocation
identifier "tokeniser"
. "."
identifier "unescapeEntities"
argument_list
( "("
identifier "inAttribute"
) ")"
; ";"
} "}"
block_comment "/**\n * @param bodyHtml HTML to parse\n * @param baseU"...
method_declaration (+30 nodes collapsed)
line_comment "// builders"
block_comment "/**\n * Create a new HTML parser. This parser treats inpu"...
method_declaration (+27 nodes collapsed)
block_comment "/**\n * Create a new XML parser. This parser assumes no k"...
method_declaration (+27 nodes collapsed)
} "}"