6099 |
if ({ |
if ({ |
6100 |
h1 => 1, h2 => 1, h3 => 1, h4 => 1, h5 => 1, h6 => 1, |
h1 => 1, h2 => 1, h3 => 1, h4 => 1, h5 => 1, h6 => 1, |
6101 |
}->{$node->[1]}) { |
}->{$node->[1]}) { |
|
## generate implied end tags |
|
|
while ({ |
|
|
dd => 1, dt => 1, li => 1, p => 1, |
|
|
}->{$self->{open_elements}->[-1]->[1]}) { |
|
|
!!!cp ('t422'); |
|
|
pop @{$self->{open_elements}}; |
|
|
} |
|
|
|
|
6102 |
!!!cp ('t423'); |
!!!cp ('t423'); |
6103 |
$i = $_; |
$i = $_; |
6104 |
last INSCOPE; |
last INSCOPE; |
6110 |
last INSCOPE; |
last INSCOPE; |
6111 |
} |
} |
6112 |
} # INSCOPE |
} # INSCOPE |
6113 |
|
|
6114 |
if ($self->{open_elements}->[-1]->[1] ne $token->{tag_name}) { |
unless (defined $i) { # has an element in scope |
6115 |
!!!cp ('t425'); |
!!!cp ('t425.1'); |
6116 |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
6117 |
} else { |
} else { |
6118 |
!!!cp ('t426'); |
## Step 1. generate implied end tags |
6119 |
|
while ({ |
6120 |
|
dd => 1, dt => 1, li => 1, p => 1, |
6121 |
|
}->{$self->{open_elements}->[-1]->[1]}) { |
6122 |
|
!!!cp ('t422'); |
6123 |
|
pop @{$self->{open_elements}}; |
6124 |
|
} |
6125 |
|
|
6126 |
|
## Step 2. |
6127 |
|
if ($self->{open_elements}->[-1]->[1] ne $token->{tag_name}) { |
6128 |
|
!!!cp ('t425'); |
6129 |
|
!!!parse-error (type => 'unmatched end tag:'.$token->{tag_name}); |
6130 |
|
} else { |
6131 |
|
!!!cp ('t426'); |
6132 |
|
} |
6133 |
|
|
6134 |
|
## Step 3. |
6135 |
|
splice @{$self->{open_elements}}, $i; |
6136 |
} |
} |
6137 |
|
|
|
splice @{$self->{open_elements}}, $i if defined $i; |
|
6138 |
!!!next-token; |
!!!next-token; |
6139 |
redo B; |
redo B; |
6140 |
} elsif ($token->{tag_name} eq 'p') { |
} elsif ($token->{tag_name} eq 'p') { |