Index: trunk/phase3/includes/Parser.php |
— | — | @@ -923,9 +923,9 @@ |
924 | 924 | $arr[$i] = "'''''"; |
925 | 925 | } |
926 | 926 | # Count the number of occurrences of bold and italics mark-ups. |
| 927 | + # We are not counting sequences of five apostrophes. |
927 | 928 | if (strlen ($arr[$i]) == 2) $numitalics++; else |
928 | | - if (strlen ($arr[$i]) == 3) $numbold++; else |
929 | | - if (strlen ($arr[$i]) == 5) { $numitalics++; $numbold++; } |
| 929 | + if (strlen ($arr[$i]) == 3) $numbold++; |
930 | 930 | } |
931 | 931 | $i++; |
932 | 932 | } |
— | — | @@ -1037,6 +1037,15 @@ |
1038 | 1038 | } |
1039 | 1039 | $i++; |
1040 | 1040 | } |
| 1041 | + # Now close all remaining tags. Notice that the order is important. |
| 1042 | + if ($state == 'strong' || $state == 'emstrong') |
| 1043 | + $output .= "</strong>"; |
| 1044 | + if ($state == 'em' || $state == 'strongem' || $state == 'emstrong') |
| 1045 | + $output .= "</em>"; |
| 1046 | + if ($state == 'strongem') |
| 1047 | + $output .= "</strong>"; |
| 1048 | + if ($state == 'both') |
| 1049 | + $output .= "<strong><em>{$buffer}</em></strong>"; |
1041 | 1050 | return $output; |
1042 | 1051 | } |
1043 | 1052 | } |