From 69eaf5751bfb2901d45c8805ab2db7e0900ea708 Mon Sep 17 00:00:00 2001 From: Arne Heizmann Date: Sat, 14 Aug 2004 08:32:57 +0000 Subject: [PATCH] Fixes to the bold/italics rendering problems [Bug 40] http://bugzilla.wikipedia.org/show_bug.cgi?id=40 --- includes/Parser.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/Parser.php b/includes/Parser.php index a3d285794f..09fd92b7b5 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -963,7 +963,8 @@ class Parser # Count the number of occurrences of bold and italics mark-ups. # We are not counting sequences of five apostrophes. if (strlen ($arr[$i]) == 2) $numitalics++; else - if (strlen ($arr[$i]) == 3) $numbold++; + if (strlen ($arr[$i]) == 3) $numbold++; else + if (strlen ($arr[$i]) == 5) { $numitalics++; $numbold++; } } $i++; } @@ -1008,7 +1009,9 @@ class Parser $arr [ $firstmultiletterword-1 ] .= "'"; } # ... otherwise use the first one that has neither. - else + # (notice that it is possible for all three to be -1 if, for example, + # there is only one pentuple-apostrophe in the line) + else if ($firstspace > -1) { $arr [ $firstspace ] = "''"; $arr [ $firstspace-1 ] .= "'"; -- 2.20.1