1 | <?php |
||
16 | class TreeBuildingRules |
||
17 | { |
||
18 | protected static $tags = array( |
||
19 | 'li' => 1, |
||
20 | 'dd' => 1, |
||
21 | 'dt' => 1, |
||
22 | 'rt' => 1, |
||
23 | 'rp' => 1, |
||
24 | 'tr' => 1, |
||
25 | 'th' => 1, |
||
26 | 'td' => 1, |
||
27 | 'thead' => 1, |
||
28 | 'tfoot' => 1, |
||
29 | 'tbody' => 1, |
||
30 | 'table' => 1, |
||
31 | 'optgroup' => 1, |
||
32 | 'option' => 1, |
||
33 | ); |
||
34 | |||
35 | /** |
||
36 | * Returns true if the given tagname has special processing rules. |
||
37 | */ |
||
38 | 103 | public function hasRules($tagname) |
|
42 | |||
43 | /** |
||
44 | * Evaluate the rule for the current tag name. |
||
45 | * |
||
46 | * This may modify the existing DOM. |
||
47 | * |
||
48 | * @return \DOMElement the new Current DOM element |
||
49 | */ |
||
50 | 6 | public function evaluate($new, $current) |
|
93 | |||
94 | 2 | protected function handleLI($ele, $current) |
|
100 | |||
101 | 1 | protected function handleDT($ele, $current) |
|
108 | |||
109 | protected function handleRT($ele, $current) |
||
116 | |||
117 | 6 | protected function closeIfCurrentMatches($ele, $current, $match) |
|
127 | } |
||
128 |