From: Steve Sanbeg Date: Thu, 7 Dec 2006 18:48:29 +0000 (+0000) Subject: Add variable for edit section offset, to help account for sections that were not... X-Git-Tag: 1.31.0-rc.0~54964 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=cad8e5f472136ee0bdf491c89ec56fc09c41c89b;p=lhc%2Fweb%2Fwiklou.git Add variable for edit section offset, to help account for sections that were not transcluded. --- diff --git a/includes/Parser.php b/includes/Parser.php index 789b46ad56..b1f5fbb70b 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -2863,6 +2863,7 @@ class Parser $noparse = false; # Unsafe HTML tags should not be stripped, etc. $noargs = false; # Don't replace triple-brace arguments in $text $replaceHeadings = false; # Make the edit section links go to the template not the article + $headingOffset = 0; # Skip headings when number, to account for those that weren't transcluded. $isHTML = false; # $text is HTML, armour it against wikitext transformation $forceRawInterwiki = false; # Force interwiki transclusion to be done in raw mode not rendered @@ -3176,7 +3177,7 @@ class Parser $m = preg_split('/(^={1,6}.*?={1,6}\s*?$)/m', $text, -1, PREG_SPLIT_DELIM_CAPTURE); $text = ''; - $nsec = 0; + $nsec = $headingOffset; for( $i = 0; $i < count($m); $i += 2 ) { $text .= $m[$i]; if (!isset($m[$i + 1]) || $m[$i + 1] == "") continue;