From b0c2c0449d13e302cb771d59f7474c95517a35ed Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 11 Sep 2004 08:40:26 +0000 Subject: [PATCH] Use and for '' and ''' instead of and . There's no good reason to use and here; they increase cache storage and bandwidth requirements ;) and may be abusing semantic markup. * Bug 369: '' should be interpreted as , not http://bugzilla.wikipedia.org/show_bug.cgi?id=369 * Bug 370: ''' should be interpreted as , not http://bugzilla.wikipedia.org/show_bug.cgi?id=370 --- includes/Parser.php | 68 ++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/includes/Parser.php b/includes/Parser.php index b59ac6c369..34820010d9 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -761,42 +761,42 @@ class Parser { if (strlen ($r) == 2) { - if ($state == 'em') - { $output .= ''; $state = ''; } - else if ($state == 'strongem') - { $output .= ''; $state = 'strong'; } - else if ($state == 'emstrong') - { $output .= ''; $state = 'strong'; } + if ($state == 'i') + { $output .= ''; $state = ''; } + else if ($state == 'bi') + { $output .= ''; $state = 'b'; } + else if ($state == 'ib') + { $output .= ''; $state = 'b'; } else if ($state == 'both') - { $output .= ''.$buffer.''; $state = 'strong'; } - else # $state can be 'strong' or '' - { $output .= ''; $state .= 'em'; } + { $output .= ''.$buffer.''; $state = 'b'; } + else # $state can be 'b' or '' + { $output .= ''; $state .= 'i'; } } else if (strlen ($r) == 3) { - if ($state == 'strong') - { $output .= ''; $state = ''; } - else if ($state == 'strongem') - { $output .= ''; $state = 'em'; } - else if ($state == 'emstrong') - { $output .= ''; $state = 'em'; } + if ($state == 'b') + { $output .= ''; $state = ''; } + else if ($state == 'bi') + { $output .= ''; $state = 'i'; } + else if ($state == 'ib') + { $output .= ''; $state = 'i'; } else if ($state == 'both') - { $output .= ''.$buffer.''; $state = 'em'; } - else # $state can be 'em' or '' - { $output .= ''; $state .= 'strong'; } + { $output .= ''.$buffer.''; $state = 'i'; } + else # $state can be 'i' or '' + { $output .= ''; $state .= 'b'; } } else if (strlen ($r) == 5) { - if ($state == 'strong') - { $output .= ''; $state = 'em'; } - else if ($state == 'em') - { $output .= ''; $state = 'strong'; } - else if ($state == 'strongem') - { $output .= ''; $state = ''; } - else if ($state == 'emstrong') - { $output .= ''; $state = ''; } + if ($state == 'b') + { $output .= ''; $state = 'i'; } + else if ($state == 'i') + { $output .= ''; $state = 'b'; } + else if ($state == 'bi') + { $output .= ''; $state = ''; } + else if ($state == 'ib') + { $output .= ''; $state = ''; } else if ($state == 'both') - { $output .= ''.$buffer.''; $state = ''; } + { $output .= ''.$buffer.''; $state = ''; } else # ($state == '') { $buffer = ''; $state = 'both'; } } @@ -804,14 +804,14 @@ class Parser $i++; } # Now close all remaining tags. Notice that the order is important. - if ($state == 'strong' || $state == 'emstrong') - $output .= ''; - if ($state == 'em' || $state == 'strongem' || $state == 'emstrong') - $output .= ''; - if ($state == 'strongem') - $output .= ''; + if ($state == 'b' || $state == 'ib') + $output .= ''; + if ($state == 'i' || $state == 'bi' || $state == 'ib') + $output .= ''; + if ($state == 'bi') + $output .= ''; if ($state == 'both') - $output .= ''.$buffer.''; + $output .= ''.$buffer.''; return $output; } } -- 2.20.1