From cad8e5f472136ee0bdf491c89ec56fc09c41c89b Mon Sep 17 00:00:00 2001 From: Steve Sanbeg Date: Thu, 7 Dec 2006 18:48:29 +0000 Subject: [PATCH] Add variable for edit section offset, to help account for sections that were not transcluded. --- includes/Parser.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.20.1