r61613 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61612‎ | r61613 | r61614 >
Date:23:05, 27 January 2010
Author:platonides
Status:deferred
Tags:
Comment:
Make six quotes the first place to look when looking for a quote to make literal.
This makes the output closer to the pre-6' one, and more consistent.
See r61052#c5436
Modified paths:
  • /branches/platonides/phase3/includes/parser/Parser.php (modified) (history)
  • /branches/platonides/phase3/maintenance/parserTests.txt (modified) (history)

Diff [purge]

Index: branches/platonides/phase3/maintenance/parserTests.txt
@@ -7611,15 +7611,21 @@
76127612
76137613 ''Italic'''BoldItalic''''''Normal'''''
76147614
 7615+''Italic'''BoldItalic''''''Normal
 7616+
76157617 '''''BoldItalic''''''MoreBoldItalic''
76167618
76177619 ''''''Normal
 7620+
 7621+'''''Frabnaggilywort''''''s pegged revision.
76187622 !!result
76197623 <p><i>Italic'</i><b>Bold</b>
7620 -</p><p><b>Bold<i>BoldItalic'</i></b>Normal
 7624+</p><p><b>Bold<i>BoldItalic&#39;</i></b>Normal
76217625 </p><p><i>Italic<b>BoldItalic'</b></i>Normal
 7626+</p><p><i>Italic<b>BoldItalic&#39;</b></i>Normal
76227627 </p><p><i><b>BoldItalic</b><b>MoreBoldItalic</b></i>
76237628 </p><p>Normal
 7629+</p><p><i><b>Frabnaggilywort&#39;</b></i>s pegged revision.
76247630 </p>
76257631 !!end
76267632
Index: branches/platonides/phase3/includes/parser/Parser.php
@@ -1126,7 +1126,9 @@
11271127 if ( ( $numbold % 2 == 1 ) && ( $numitalics % 2 == 1 ) )
11281128 {
11291129
1130 - # This algorithm moves the literal quote at the
 1130+ # This algorithm takes as literal ' the first from six
 1131+ # quotes, since <b></b>/</b><b> wouldn't be too useful,
 1132+ # else it moves the literal quote at the
11311133 # right of a single word, at the right of a
11321134 # multiletter word or at the right of a space.
11331135 # Otherwise, it does nothing.
@@ -1138,6 +1140,7 @@
11391141 # texty quotes to &#39; which shouldn't matter.
11401142
11411143 $quoteBalancerReplacements = array(
 1144+ "/''''''(?!')/"=>"&#39;'''''",
11421145 "/(?<= [^ ])'''(?!')/"=>"&#39;''",
11431146 "/(?<=[^ '])'''(?!')/"=>"&#39;''",
11441147 "/(^|(?<=[^'])) '''(?!')/"=>" &#39;''");

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r61052* (bug 18765) Increased consistency of bold-italic markup for unbalanced quotes....platonides16:18, 14 January 2010

Status & tagging log