r4578 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r4577‎ | r4578 | r4579 >
Date:12:37, 7 August 2004
Author:timwi
Status:old
Tags:
Comment:
Bugfix: produce valid XHTML even if user entered invalid '' / ''' mark-up.
Modified paths:
  • /trunk/phase3/includes/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Parser.php
@@ -923,9 +923,9 @@
924924 $arr[$i] = "'''''";
925925 }
926926 # Count the number of occurrences of bold and italics mark-ups.
 927+ # We are not counting sequences of five apostrophes.
927928 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++;
930930 }
931931 $i++;
932932 }
@@ -1037,6 +1037,15 @@
10381038 }
10391039 $i++;
10401040 }
 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>";
10411050 return $output;
10421051 }
10431052 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r61519Parser documentation:...platonides16:16, 26 January 2010

Status & tagging log