@@ -172,8 +172,7 @@ discard block |
||
| 172 | 172 | $CurrentBlock = $Block; |
| 173 | 173 | |
| 174 | 174 | continue; |
| 175 | - } |
|
| 176 | - else |
|
| 175 | + } else |
|
| 177 | 176 | { |
| 178 | 177 | if ($this->isBlockCompletable($CurrentBlock['type'])) |
| 179 | 178 | { |
@@ -232,8 +231,7 @@ discard block |
||
| 232 | 231 | if (isset($CurrentBlock) and ! isset($CurrentBlock['type']) and ! isset($CurrentBlock['interrupted'])) |
| 233 | 232 | { |
| 234 | 233 | $CurrentBlock['element']['text'] .= "\n".$text; |
| 235 | - } |
|
| 236 | - else |
|
| 234 | + } else |
|
| 237 | 235 | { |
| 238 | 236 | $Blocks []= $CurrentBlock; |
| 239 | 237 | |
@@ -700,8 +698,7 @@ discard block |
||
| 700 | 698 | |
| 701 | 699 | $Block['void'] = true; |
| 702 | 700 | } |
| 703 | - } |
|
| 704 | - else |
|
| 701 | + } else |
|
| 705 | 702 | { |
| 706 | 703 | if (isset($matches[2]) or in_array($matches[1], $this->voidElements)) |
| 707 | 704 | { |
@@ -725,18 +722,21 @@ discard block |
||
| 725 | 722 | return; |
| 726 | 723 | } |
| 727 | 724 | |
| 728 | - if (preg_match('/^<'.$Block['name'].'(?:[ ]*'.$this->regexHtmlAttribute.')*[ ]*>/i', $Line['text'])) # open |
|
| 725 | + if (preg_match('/^<'.$Block['name'].'(?:[ ]*'.$this->regexHtmlAttribute.')*[ ]*>/i', $Line['text'])) { |
|
| 726 | + # open |
|
| 729 | 727 | { |
| 730 | 728 | $Block['depth'] ++; |
| 731 | 729 | } |
| 730 | + } |
|
| 732 | 731 | |
| 733 | - if (preg_match('/(.*?)<\/'.$Block['name'].'>[ ]*$/i', $Line['text'], $matches)) # close |
|
| 732 | + if (preg_match('/(.*?)<\/'.$Block['name'].'>[ ]*$/i', $Line['text'], $matches)) { |
|
| 733 | + # close |
|
| 734 | 734 | { |
| 735 | 735 | if ($Block['depth'] > 0) |
| 736 | 736 | { |
| 737 | 737 | $Block['depth'] --; |
| 738 | - } |
|
| 739 | - else |
|
| 738 | + } |
|
| 739 | + } else |
|
| 740 | 740 | { |
| 741 | 741 | $Block['closed'] = true; |
| 742 | 742 | } |
@@ -1113,12 +1113,10 @@ discard block |
||
| 1113 | 1113 | if ($Excerpt['text'][1] === $marker and preg_match($this->StrongRegex[$marker], $Excerpt['text'], $matches)) |
| 1114 | 1114 | { |
| 1115 | 1115 | $emphasis = 'strong'; |
| 1116 | - } |
|
| 1117 | - elseif (preg_match($this->EmRegex[$marker], $Excerpt['text'], $matches)) |
|
| 1116 | + } elseif (preg_match($this->EmRegex[$marker], $Excerpt['text'], $matches)) |
|
| 1118 | 1117 | { |
| 1119 | 1118 | $emphasis = 'em'; |
| 1120 | - } |
|
| 1121 | - else |
|
| 1119 | + } else |
|
| 1122 | 1120 | { |
| 1123 | 1121 | return; |
| 1124 | 1122 | } |
@@ -1201,8 +1199,7 @@ discard block |
||
| 1201 | 1199 | $extent += strlen($matches[0]); |
| 1202 | 1200 | |
| 1203 | 1201 | $remainder = substr($remainder, $extent); |
| 1204 | - } |
|
| 1205 | - else |
|
| 1202 | + } else |
|
| 1206 | 1203 | { |
| 1207 | 1204 | return; |
| 1208 | 1205 | } |
@@ -1217,8 +1214,7 @@ discard block |
||
| 1217 | 1214 | } |
| 1218 | 1215 | |
| 1219 | 1216 | $extent += strlen($matches[0]); |
| 1220 | - } |
|
| 1221 | - else |
|
| 1217 | + } else |
|
| 1222 | 1218 | { |
| 1223 | 1219 | if (preg_match('/^\s*\[(.*?)\]/', $remainder, $matches)) |
| 1224 | 1220 | { |
@@ -1226,8 +1222,7 @@ discard block |
||
| 1226 | 1222 | $definition = strtolower($definition); |
| 1227 | 1223 | |
| 1228 | 1224 | $extent += strlen($matches[0]); |
| 1229 | - } |
|
| 1230 | - else |
|
| 1225 | + } else |
|
| 1231 | 1226 | { |
| 1232 | 1227 | $definition = strtolower($Element['text']); |
| 1233 | 1228 | } |
@@ -1375,8 +1370,7 @@ discard block |
||
| 1375 | 1370 | if ($this->breaksEnabled) |
| 1376 | 1371 | { |
| 1377 | 1372 | $text = preg_replace('/[ ]*\n/', "<br />\n", $text); |
| 1378 | - } |
|
| 1379 | - else |
|
| 1373 | + } else |
|
| 1380 | 1374 | { |
| 1381 | 1375 | $text = preg_replace('/(?:[ ][ ]+|[ ]*\\\\)\n/', "<br />\n", $text); |
| 1382 | 1376 | $text = str_replace(" \n", "\n", $text); |
@@ -1413,15 +1407,13 @@ discard block |
||
| 1413 | 1407 | if (isset($Element['handler'])) |
| 1414 | 1408 | { |
| 1415 | 1409 | $markup .= $this->{$Element['handler']}($Element['text']); |
| 1416 | - } |
|
| 1417 | - else |
|
| 1410 | + } else |
|
| 1418 | 1411 | { |
| 1419 | 1412 | $markup .= $Element['text']; |
| 1420 | 1413 | } |
| 1421 | 1414 | |
| 1422 | 1415 | $markup .= '</'.$Element['name'].'>'; |
| 1423 | - } |
|
| 1424 | - else |
|
| 1416 | + } else |
|
| 1425 | 1417 | { |
| 1426 | 1418 | $markup .= ' />'; |
| 1427 | 1419 | } |