| 146 |
continue; |
continue; |
| 147 |
break; |
break; |
| 148 |
|
|
| 149 |
//nested cases |
|
| 150 |
|
// block elements these get out attention |
| 151 |
|
case "p": |
| 152 |
case "ul": |
case "ul": |
| 153 |
case "ol": |
case "ol": |
| 154 |
case "dl": |
case "dl": |
|
case "div": |
|
|
$e = 0; |
|
|
// stack counter |
|
|
$j = 1; |
|
|
|
|
|
// if $j = 0 then stack is empty |
|
|
while ($j > 0) { |
|
|
$e += strpos(substr($text, $i+$e) , $tag); |
|
|
|
|
|
// yeah I know I'm assuming certain sizes for tags, sue me |
|
|
// new nested block |
|
|
if ($text[$i+$e-1] == '<') { |
|
|
++$j; |
|
|
} |
|
|
// end of block |
|
|
else if ($text[$i+$e-1] == '/') { |
|
|
--$j; |
|
|
} |
|
|
// skip current tag |
|
|
$e += 2; |
|
|
} |
|
|
|
|
|
$content = substr($text, $i+1, $e); |
|
|
$output .= _get_dir(strip_tags($content)); |
|
|
$e += strlen($tag); |
|
|
$output.= substr($text, $i, $e); |
|
|
$i += $e; |
|
|
break; |
|
|
|
|
|
// block elements these get out attention |
|
|
case "p": |
|
|
case "blockquote": |
|
| 155 |
case "pre": |
case "pre": |
| 156 |
case "h1": |
case "h1": |
| 157 |
case "h2": |
case "h2": |