Merge "Add dotall modifier to EDITSECTION_REGEX"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sun, 18 Dec 2016 02:53:47 +0000 (02:53 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sun, 18 Dec 2016 02:53:47 +0000 (02:53 +0000)
includes/parser/ParserOutput.php
tests/parser/parserTests.txt

index b0768b6..bfaa4f7 100644 (file)
@@ -215,7 +215,7 @@ class ParserOutput extends CacheTime {
        private $mMaxAdaptiveExpiry = INF;
 
        const EDITSECTION_REGEX =
-               '#<(?:mw:)?editsection page="(.*?)" section="(.*?)"(?:/>|>(.*?)(</(?:mw:)?editsection>))#';
+               '#<(?:mw:)?editsection page="(.*?)" section="(.*?)"(?:/>|>(.*?)(</(?:mw:)?editsection>))#s';
 
        // finalizeAdaptiveCacheExpiry() uses TTL = MAX( m * PARSE_TIME + b, MIN_AR_TTL)
        // Current values imply that m=3933.333333 and b=-333.333333
index b18f1e7..505bc2d 100644 (file)
@@ -528,6 +528,17 @@ Extra newlines between heading and content are swallowed
 </p>
 !! end
 
+!! test
+Heading with line break in nowiki
+!! wikitext
+== A <nowiki>B
+C</nowiki> ==
+!! html
+<h2><span class="mw-headline" id="A_B.0AC">A B
+C</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: A B&#10;C">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
+
+!! end
+
 !! test
 Parsing an URL
 !! wikitext