r68374 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68373‎ | r68374 | r68375 >
Date:20:33, 21 June 2010
Author:conrad
Status:ok
Tags:
Comment:
(bug 19910) Preprocess headings of the form "===+\s+" in the same way as Parser::doHeadings()
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/parser/Preprocessor_DOM.php (modified) (history)
  • /trunk/phase3/includes/parser/Preprocessor_Hash.php (modified) (history)
  • /trunk/phase3/maintenance/parserTests.txt (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/parserTests.txt
@@ -3903,6 +3903,23 @@
39043904 !!end
39053905
39063906 !! test
 3907+Short headings with trailing space should match behaviour of Parser::doHeadings (bug 19910)
 3908+!! input
 3909+===
 3910+The line above must have a trailing space!
 3911+=== <!--
 3912+--> <!-- -->
 3913+But just in case it doesn't...
 3914+!! result
 3915+<h1><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: =">edit</a>]</span> <span class="mw-headline" id=".3D">=</span></h1>
 3916+<p>The line above must have a trailing space!
 3917+</p>
 3918+<h1><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: =">edit</a>]</span> <span class="mw-headline" id=".3D_2">=</span></h1>
 3919+<p>But just in case it doesn't...
 3920+</p>
 3921+!! end
 3922+
 3923+!! test
39073924 BUG 1219 URL next to image (broken)
39083925 !! input
39093926 http://example.com[[Image:foobar.jpg]]
@@ -5849,6 +5866,22 @@
58505867 ==marked==
58515868 !!end
58525869
 5870+# Test behaviour of bug 19910
 5871+!! test
 5872+Sectiion with all-equals
 5873+!! options
 5874+section=2
 5875+!! input
 5876+===
 5877+The line above must have a trailing space
 5878+=== <!--
 5879+--> <!-- -->
 5880+But just in case it doesn't...
 5881+!! result
 5882+=== <!--
 5883+--> <!-- -->
 5884+But just in case it doesn't...
 5885+!! end
58535886
58545887 !! test
58555888 Section replacement test (section 0)
Index: trunk/phase3/includes/parser/Preprocessor_Hash.php
@@ -428,7 +428,7 @@
429429 $count = $piece->count;
430430 $equalsLength = strspn( $revText, '=', strlen( $text ) - $searchStart );
431431 if ( $equalsLength > 0 ) {
432 - if ( $i - $equalsLength == $piece->startPos ) {
 432+ if ( $searchStart - $equalsLength == $piece->startPos ) {
433433 // This is just a single string of equals signs on its own line
434434 // Replicate the doHeadings behaviour /={count}(.+)={count}/
435435 // First find out how many equals signs there really are (don't stop at 6)
Index: trunk/phase3/includes/parser/Preprocessor_DOM.php
@@ -467,7 +467,7 @@
468468 $count = $piece->count;
469469 $equalsLength = strspn( $revText, '=', strlen( $text ) - $searchStart );
470470 if ( $equalsLength > 0 ) {
471 - if ( $i - $equalsLength == $piece->startPos ) {
 471+ if ( $searchStart - $equalsLength == $piece->startPos ) {
472472 // This is just a single string of equals signs on its own line
473473 // Replicate the doHeadings behaviour /={count}(.+)={count}/
474474 // First find out how many equals signs there really are (don't stop at 6)
Index: trunk/phase3/RELEASE-NOTES
@@ -236,6 +236,7 @@
237237 * (bug 24009) Include implicit groups in action=query&list=users&usprop=groups
238238 * (bug 24016) API: Handle parameters specified in simple string syntax
239239 ( 'paramname' => 'defaultval' ) correctly when outputting help
 240+* (bug 19910) Headings of the form ===+\s+ are now displayed as valid headings
240241
241242 === Languages updated in 1.17 ===
242243

Follow-up revisions

RevisionCommit summaryAuthorDate
r68452Move bug 19910 / r68374 RELEASE-NOTESreedy12:35, 23 June 2010

Status & tagging log