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–211 unchanged (211 lines)
212 "meta", "link", "base", "frame", "img", "br", "wbr", "embed", "hr", "input", "keygen", "col", "command",
213 "device"
214 };
215 private static final String[] formatAsInlineTags = {
216 "title", "a", "p", "h1", "h2", "h3", "h4", "h5", "h6", "pre", "address", "li", "th", "td", "script", "style"
217 };
218 private static final String[] preserveWhitespaceTags = {"pre", "plaintext", "title"};
219
220 static {
221 // creates
222 for (String tagName : blockTags) {
223 Tag tag = new Tag(tagName);
224 register(tag);
…lines 225–263 unchanged (39 lines)

After

…lines 1–211 unchanged (211 lines)
212 "meta", "link", "base", "frame", "img", "br", "wbr", "embed", "hr", "input", "keygen", "col", "command",
213 "device"
214 };
215 private static final String[] formatAsInlineTags = {
216 "title", "a", "p", "h1", "h2", "h3", "h4", "h5", "h6", "pre", "address", "li", "th", "td", "script", "style"
217 };
218 private static final String[] preserveWhitespaceTags = {"pre", "plaintext", "title", "textarea"};
219
220 static {
221 // creates
222 for (String tagName : blockTags) {
223 Tag tag = new Tag(tagName);
224 register(tag);
…lines 225–263 unchanged (39 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 "helper"
. "."
identifier "Validate"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "HashMap"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
; ";"
block_comment "/**\n * HTML Tag capabilities.\n *\n * @author Jonathan Hedley,"...
class_declaration
modifiers
public "public"
class "class"
identifier "Tag"
class_body
{ "{"
field_declaration (+30 nodes collapsed)
line_comment "// map of known tags"
field_declaration
modifiers
private "private"
type_identifier "String"
variable_declarator
identifier "tagName"
; ";"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "isBlock"
= "="
true "true"
; ";"
line_comment "// block or inline"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "formatAsBlock"
= "="
true "true"
; ";"
line_comment "// should be formatted as a block"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "canContainBlock"
= "="
true "true"
; ";"
line_comment "// Can this tag hold block level tags?"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "canContainInline"
= "="
true "true"
; ";"
line_comment "// only pcdata if not"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "empty"
= "="
false "false"
; ";"
line_comment "// can hold nothing; e.g. img"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "selfClosing"
= "="
false "false"
; ";"
line_comment "// can self close (<foo />). used for unknown tags that self"...
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "preserveWhitespace"
= "="
false "false"
; ";"
line_comment "// for pre, textarea, script etc"
constructor_declaration (+28 nodes collapsed)
block_comment "/**\n * Get this tag's name.\n *\n * @return the ta"...
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "getName"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "tagName"
; ";"
} "}"
block_comment "/**\n * Get a Tag by name. If not previously defined (unk"...
method_declaration (+123 nodes collapsed)
block_comment "/**\n * Gets if this is a block tag.\n *\n * @retur"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isBlock"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "isBlock"
; ";"
} "}"
block_comment "/**\n * Gets if this tag should be formatted as a block ("...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "formatAsBlock"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "formatAsBlock"
; ";"
} "}"
block_comment "/**\n * Gets if this tag can contain block tags.\n *\n "...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "canContainBlock"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "canContainBlock"
; ";"
} "}"
block_comment "/**\n * Gets if this tag is an inline tag.\n *\n * "...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isInline"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
unary_expression
! "!"
identifier "isBlock"
; ";"
} "}"
block_comment "/**\n * Gets if this tag is a data only tag.\n *\n "...
method_declaration (+26 nodes collapsed)
block_comment "/**\n * Get if this is an empty tag\n *\n * @return"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isEmpty"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "empty"
; ";"
} "}"
block_comment "/**\n * Get if this tag is self closing.\n *\n * @r"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isSelfClosing"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
binary_expression
identifier "empty"
|| "||"
identifier "selfClosing"
; ";"
} "}"
block_comment "/**\n * Get if this is a pre-defined tag, or was auto cre"...
method_declaration (+22 nodes collapsed)
block_comment "/**\n * Check if this tagname is a known tag.\n *\n "...
method_declaration (+26 nodes collapsed)
block_comment "/**\n * Get if this tag should preserve whitespace within"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "preserveWhitespace"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "preserveWhitespace"
; ";"
} "}"
method_declaration
type_identifier "Tag"
identifier "setSelfClosing"
formal_parameters
( "("
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "selfClosing"
= "="
true "true"
; ";"
return_statement
return "return"
this "this"
; ";"
} "}"
method_declaration (+197 nodes collapsed)
method_declaration (+173 nodes collapsed)
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "toString"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "tagName"
; ";"
} "}"
line_comment "// internal static initialisers:"
line_comment "// prepped from http://www.w3.org/TR/REC-html40/sgml/dtd.htm"...
field_declaration (+306 nodes collapsed)
field_declaration (+296 nodes collapsed)
field_declaration (+86 nodes collapsed)
field_declaration (+96 nodes collapsed)
field_declaration
modifiers
private "private"
static "static"
final "final"
array_type
type_identifier "String"
dimensions
[ "["
] "]"
variable_declarator
identifier "preserveWhitespaceTags"
= "="
array_initializer
{ "{"
string_literal
" "\""
string_fragment "pre"
" "\""
, ","
string_literal
" "\""
string_fragment "plaintext"
" "\""
, ","
string_literal
" "\""
string_fragment "title"
" "\""
} "}"
; ";"
static_initializer (+248 nodes collapsed)
method_declaration (+43 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 "helper"
. "."
identifier "Validate"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "HashMap"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
; ";"
block_comment "/**\n * HTML Tag capabilities.\n *\n * @author Jonathan Hedley,"...
class_declaration
modifiers
public "public"
class "class"
identifier "Tag"
class_body
{ "{"
field_declaration (+30 nodes collapsed)
line_comment "// map of known tags"
field_declaration
modifiers
private "private"
type_identifier "String"
variable_declarator
identifier "tagName"
; ";"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "isBlock"
= "="
true "true"
; ";"
line_comment "// block or inline"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "formatAsBlock"
= "="
true "true"
; ";"
line_comment "// should be formatted as a block"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "canContainBlock"
= "="
true "true"
; ";"
line_comment "// Can this tag hold block level tags?"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "canContainInline"
= "="
true "true"
; ";"
line_comment "// only pcdata if not"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "empty"
= "="
false "false"
; ";"
line_comment "// can hold nothing; e.g. img"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "selfClosing"
= "="
false "false"
; ";"
line_comment "// can self close (<foo />). used for unknown tags that self"...
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "preserveWhitespace"
= "="
false "false"
; ";"
line_comment "// for pre, textarea, script etc"
constructor_declaration (+28 nodes collapsed)
block_comment "/**\n * Get this tag's name.\n *\n * @return the ta"...
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "getName"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "tagName"
; ";"
} "}"
block_comment "/**\n * Get a Tag by name. If not previously defined (unk"...
method_declaration (+123 nodes collapsed)
block_comment "/**\n * Gets if this is a block tag.\n *\n * @retur"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isBlock"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "isBlock"
; ";"
} "}"
block_comment "/**\n * Gets if this tag should be formatted as a block ("...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "formatAsBlock"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "formatAsBlock"
; ";"
} "}"
block_comment "/**\n * Gets if this tag can contain block tags.\n *\n "...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "canContainBlock"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "canContainBlock"
; ";"
} "}"
block_comment "/**\n * Gets if this tag is an inline tag.\n *\n * "...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isInline"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
unary_expression
! "!"
identifier "isBlock"
; ";"
} "}"
block_comment "/**\n * Gets if this tag is a data only tag.\n *\n "...
method_declaration (+26 nodes collapsed)
block_comment "/**\n * Get if this is an empty tag\n *\n * @return"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isEmpty"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "empty"
; ";"
} "}"
block_comment "/**\n * Get if this tag is self closing.\n *\n * @r"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isSelfClosing"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
binary_expression
identifier "empty"
|| "||"
identifier "selfClosing"
; ";"
} "}"
block_comment "/**\n * Get if this is a pre-defined tag, or was auto cre"...
method_declaration (+22 nodes collapsed)
block_comment "/**\n * Check if this tagname is a known tag.\n *\n "...
method_declaration (+26 nodes collapsed)
block_comment "/**\n * Get if this tag should preserve whitespace within"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "preserveWhitespace"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "preserveWhitespace"
; ";"
} "}"
method_declaration
type_identifier "Tag"
identifier "setSelfClosing"
formal_parameters
( "("
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "selfClosing"
= "="
true "true"
; ";"
return_statement
return "return"
this "this"
; ";"
} "}"
method_declaration (+197 nodes collapsed)
method_declaration (+173 nodes collapsed)
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "toString"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "tagName"
; ";"
} "}"
line_comment "// internal static initialisers:"
line_comment "// prepped from http://www.w3.org/TR/REC-html40/sgml/dtd.htm"...
field_declaration (+306 nodes collapsed)
field_declaration (+296 nodes collapsed)
field_declaration (+86 nodes collapsed)
field_declaration (+96 nodes collapsed)
field_declaration
modifiers
private "private"
static "static"
final "final"
array_type
type_identifier "String"
dimensions
[ "["
] "]"
variable_declarator
identifier "preserveWhitespaceTags"
= "="
array_initializer
{ "{"
string_literal
" "\""
string_fragment "pre"
" "\""
, ","
string_literal
" "\""
string_fragment "plaintext"
" "\""
, ","
string_literal
" "\""
string_fragment "title"
" "\""
, ","
string_literal
" "\""
string_fragment "textarea"
" "\""
} "}"
; ";"
static_initializer (+248 nodes collapsed)
method_declaration (+43 nodes collapsed)
} "}"