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–375 unchanged (375 lines)
376 tb.insert(startTag);
377 } else if (StringUtil.inSorted(name, Constants.InBodyStartPreListing)) {
378 if (tb.inButtonScope("p")) {
379 tb.processEndTag("p");
380 }
381 tb.insert(startTag);
382 tb.framesetOk(false);
383 } else if (name.equals("form")) {
384 if (tb.getFormElement() != null) {
385 tb.error(this);
386 return false;
387 }
388 if (tb.inButtonScope("p")) {
…lines 389–1531 unchanged (1143 lines)

After

…lines 1–375 unchanged (375 lines)
376 tb.insert(startTag);
377 } else if (StringUtil.inSorted(name, Constants.InBodyStartPreListing)) {
378 if (tb.inButtonScope("p")) {
379 tb.processEndTag("p");
380 }
381 tb.insert(startTag);
382 tb.reader.matchConsume("\n"); // ignore LF if next token
383 tb.framesetOk(false);
384 } else if (name.equals("form")) {
385 if (tb.getFormElement() != null) {
386 tb.error(this);
387 return false;
388 }
…lines 389–1532 unchanged (1144 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 "StringUtil"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
identifier "Attribute"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
identifier "Attributes"
; ";"
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 "DocumentType"
; ";"
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 "ArrayList"
; ";"
block_comment "/**\n * The Tree Builder's current state. Each state embodies"...
enum_declaration
enum "enum"
identifier "HtmlTreeBuilderState"
enum_body
{ "{"
enum_constant (+258 nodes collapsed)
, ","
enum_constant (+342 nodes collapsed)
, ","
enum_constant (+384 nodes collapsed)
, ","
enum_constant (+729 nodes collapsed)
, ","
enum_constant (+469 nodes collapsed)
, ","
enum_constant (+593 nodes collapsed)
, ","
enum_constant
identifier "InBody"
class_body
{ "{"
method_declaration
boolean_type "boolean"
identifier "process"
formal_parameters
( "("
formal_parameter
type_identifier "Token"
identifier "t"
, ","
formal_parameter
type_identifier "HtmlTreeBuilder"
identifier "tb"
) ")"
block
{ "{"
switch_expression
switch "switch"
parenthesized_expression
( "("
field_access
identifier "t"
. "."
identifier "type"
) ")"
switch_block
{ "{"
switch_block_statement_group (+141 nodes collapsed)
switch_block_statement_group (+27 nodes collapsed)
switch_block_statement_group (+22 nodes collapsed)
switch_block_statement_group
switch_label
case "case"
identifier "StartTag"
: ":"
local_variable_declaration
scoped_type_identifier
type_identifier "Token"
. "."
type_identifier "StartTag"
variable_declarator
identifier "startTag"
= "="
method_invocation
identifier "t"
. "."
identifier "asStartTag"
argument_list
( "("
) ")"
; ";"
line_comment "// todo - refactor to a switch statement"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "name"
= "="
method_invocation
identifier "startTag"
. "."
identifier "normalName"
argument_list
( "("
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "name"
. "."
identifier "equals"
argument_list
( "("
string_literal
" "\""
string_fragment "a"
" "\""
) ")"
) ")"
block (+131 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "StringUtil"
. "."
identifier "inSorted"
argument_list
( "("
identifier "name"
, ","
field_access
identifier "Constants"
. "."
identifier "InBodyStartEmptyFormatters"
) ")"
) ")"
block (+32 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "StringUtil"
. "."
identifier "inSorted"
argument_list
( "("
identifier "name"
, ","
field_access
identifier "Constants"
. "."
identifier "InBodyStartPClosers"
) ")"
) ")"
block (+45 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "name"
. "."
identifier "equals"
argument_list
( "("
string_literal
" "\""
string_fragment "span"
" "\""
) ")"
) ")"
block (+23 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "name"
. "."
identifier "equals"
argument_list
( "("
string_literal
" "\""
string_fragment "li"
" "\""
) ")"
) ")"
block (+199 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "name"
. "."
identifier "equals"
argument_list
( "("
string_literal
" "\""
string_fragment "html"
" "\""
) ")"
) ")"
block (+88 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "StringUtil"
. "."
identifier "inSorted"
argument_list
( "("
identifier "name"
, ","
field_access
identifier "Constants"
. "."
identifier "InBodyStartToHead"
) ")"
) ")"
block
{ "{"
return_statement
return "return"
method_invocation
identifier "tb"
. "."
identifier "process"
argument_list
( "("
identifier "t"
, ","
identifier "InHead"
) ")"
; ";"
} "}"
else "else"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "name"
. "."
identifier "equals"
argument_list
( "("
string_literal
" "\""
string_fragment "body"
" "\""
) ")"
) ")"
block (+180 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "name"
. "."
identifier "equals"
argument_list
( "("
string_literal
" "\""
string_fragment "frameset"
" "\""
) ")"
) ")"
block (+218 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "StringUtil"
. "."
identifier "inSorted"
argument_list
( "("
identifier "name"
, ","
field_access
identifier "Constants"
. "."
identifier "Headings"
) ")"
) ")"
block (+97 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "StringUtil"
. "."
identifier "inSorted"
argument_list
( "("
identifier "name"
, ","
field_access
identifier "Constants"
. "."
identifier "InBodyStartPreListing"
) ")"
) ")"
block
{ "{"
if_statement (+32 nodes collapsed)
expression_statement
method_invocation
identifier "tb"
. "."
identifier "insert"
argument_list
( "("
identifier "startTag"
) ")"
; ";"
expression_statement
method_invocation
identifier "tb"
. "."
identifier "framesetOk"
argument_list
( "("
false "false"
) ")"
; ";"
} "}"
else "else"
if_statement (+2141 nodes collapsed)
break_statement
break "break"
; ";"
switch_block_statement_group (+2038 nodes collapsed)
switch_block_statement_group
switch_label
case "case"
identifier "EOF"
: ":"
line_comment "// todo: error if stack contains something not dd, dt, li, p"...
line_comment "// stop parsing"
break_statement
break "break"
; ";"
} "}"
return_statement
return "return"
true "true"
; ";"
} "}"
method_declaration (+230 nodes collapsed)
} "}"
, ","
enum_constant (+162 nodes collapsed)
, ","
enum_constant (+1162 nodes collapsed)
, ","
enum_constant (+389 nodes collapsed)
, ","
enum_constant (+494 nodes collapsed)
, ","
enum_constant (+458 nodes collapsed)
, ","
enum_constant (+700 nodes collapsed)
, ","
enum_constant (+670 nodes collapsed)
, ","
enum_constant (+634 nodes collapsed)
, ","
enum_constant (+1016 nodes collapsed)
, ","
enum_constant (+297 nodes collapsed)
, ","
enum_constant (+305 nodes collapsed)
, ","
enum_constant (+501 nodes collapsed)
, ","
enum_constant (+311 nodes collapsed)
, ","
enum_constant (+182 nodes collapsed)
, ","
enum_constant (+219 nodes collapsed)
, ","
enum_constant (+26 nodes collapsed)
enum_body_declarations (+1333 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 "StringUtil"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
identifier "Attribute"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jsoup"
. "."
identifier "nodes"
. "."
identifier "Attributes"
; ";"
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 "DocumentType"
; ";"
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 "ArrayList"
; ";"
block_comment "/**\n * The Tree Builder's current state. Each state embodies"...
enum_declaration
enum "enum"
identifier "HtmlTreeBuilderState"
enum_body
{ "{"
enum_constant (+258 nodes collapsed)
, ","
enum_constant (+342 nodes collapsed)
, ","
enum_constant (+384 nodes collapsed)
, ","
enum_constant (+729 nodes collapsed)
, ","
enum_constant (+469 nodes collapsed)
, ","
enum_constant (+593 nodes collapsed)
, ","
enum_constant
identifier "InBody"
class_body
{ "{"
method_declaration
boolean_type "boolean"
identifier "process"
formal_parameters
( "("
formal_parameter
type_identifier "Token"
identifier "t"
, ","
formal_parameter
type_identifier "HtmlTreeBuilder"
identifier "tb"
) ")"
block
{ "{"
switch_expression
switch "switch"
parenthesized_expression
( "("
field_access
identifier "t"
. "."
identifier "type"
) ")"
switch_block
{ "{"
switch_block_statement_group (+141 nodes collapsed)
switch_block_statement_group (+27 nodes collapsed)
switch_block_statement_group (+22 nodes collapsed)
switch_block_statement_group
switch_label
case "case"
identifier "StartTag"
: ":"
local_variable_declaration
scoped_type_identifier
type_identifier "Token"
. "."
type_identifier "StartTag"
variable_declarator
identifier "startTag"
= "="
method_invocation
identifier "t"
. "."
identifier "asStartTag"
argument_list
( "("
) ")"
; ";"
line_comment "// todo - refactor to a switch statement"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "name"
= "="
method_invocation
identifier "startTag"
. "."
identifier "normalName"
argument_list
( "("
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "name"
. "."
identifier "equals"
argument_list
( "("
string_literal
" "\""
string_fragment "a"
" "\""
) ")"
) ")"
block (+131 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "StringUtil"
. "."
identifier "inSorted"
argument_list
( "("
identifier "name"
, ","
field_access
identifier "Constants"
. "."
identifier "InBodyStartEmptyFormatters"
) ")"
) ")"
block (+32 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "StringUtil"
. "."
identifier "inSorted"
argument_list
( "("
identifier "name"
, ","
field_access
identifier "Constants"
. "."
identifier "InBodyStartPClosers"
) ")"
) ")"
block (+45 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "name"
. "."
identifier "equals"
argument_list
( "("
string_literal
" "\""
string_fragment "span"
" "\""
) ")"
) ")"
block (+23 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "name"
. "."
identifier "equals"
argument_list
( "("
string_literal
" "\""
string_fragment "li"
" "\""
) ")"
) ")"
block (+199 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "name"
. "."
identifier "equals"
argument_list
( "("
string_literal
" "\""
string_fragment "html"
" "\""
) ")"
) ")"
block (+88 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "StringUtil"
. "."
identifier "inSorted"
argument_list
( "("
identifier "name"
, ","
field_access
identifier "Constants"
. "."
identifier "InBodyStartToHead"
) ")"
) ")"
block
{ "{"
return_statement
return "return"
method_invocation
identifier "tb"
. "."
identifier "process"
argument_list
( "("
identifier "t"
, ","
identifier "InHead"
) ")"
; ";"
} "}"
else "else"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "name"
. "."
identifier "equals"
argument_list
( "("
string_literal
" "\""
string_fragment "body"
" "\""
) ")"
) ")"
block (+180 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "name"
. "."
identifier "equals"
argument_list
( "("
string_literal
" "\""
string_fragment "frameset"
" "\""
) ")"
) ")"
block (+218 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "StringUtil"
. "."
identifier "inSorted"
argument_list
( "("
identifier "name"
, ","
field_access
identifier "Constants"
. "."
identifier "Headings"
) ")"
) ")"
block (+97 nodes collapsed)
else "else"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "StringUtil"
. "."
identifier "inSorted"
argument_list
( "("
identifier "name"
, ","
field_access
identifier "Constants"
. "."
identifier "InBodyStartPreListing"
) ")"
) ")"
block
{ "{"
if_statement (+32 nodes collapsed)
expression_statement
method_invocation
identifier "tb"
. "."
identifier "insert"
argument_list
( "("
identifier "startTag"
) ")"
; ";"
expression_statement
method_invocation
field_access
identifier "tb"
. "."
identifier "reader"
. "."
identifier "matchConsume"
argument_list
( "("
string_literal
" "\""
escape_sequence "\\n"
" "\""
) ")"
; ";"
line_comment "// ignore LF if next token"
expression_statement
method_invocation
identifier "tb"
. "."
identifier "framesetOk"
argument_list
( "("
false "false"
) ")"
; ";"
} "}"
else "else"
if_statement (+2141 nodes collapsed)
break_statement
break "break"
; ";"
switch_block_statement_group (+2038 nodes collapsed)
switch_block_statement_group
switch_label
case "case"
identifier "EOF"
: ":"
line_comment "// todo: error if stack contains something not dd, dt, li, p"...
line_comment "// stop parsing"
break_statement
break "break"
; ";"
} "}"
return_statement
return "return"
true "true"
; ";"
} "}"
method_declaration (+230 nodes collapsed)
} "}"
, ","
enum_constant (+162 nodes collapsed)
, ","
enum_constant (+1162 nodes collapsed)
, ","
enum_constant (+389 nodes collapsed)
, ","
enum_constant (+494 nodes collapsed)
, ","
enum_constant (+458 nodes collapsed)
, ","
enum_constant (+700 nodes collapsed)
, ","
enum_constant (+670 nodes collapsed)
, ","
enum_constant (+634 nodes collapsed)
, ","
enum_constant (+1016 nodes collapsed)
, ","
enum_constant (+297 nodes collapsed)
, ","
enum_constant (+305 nodes collapsed)
, ","
enum_constant (+501 nodes collapsed)
, ","
enum_constant (+311 nodes collapsed)
, ","
enum_constant (+182 nodes collapsed)
, ","
enum_constant (+219 nodes collapsed)
, ","
enum_constant (+26 nodes collapsed)
enum_body_declarations (+1333 nodes collapsed)
} "}"