r40486 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40485‎ | r40486 | r40487 >
Date:13:44, 5 September 2008
Author:mkroetzsch
Status:old
Tags:
Comment:
Hide TOC when using parse(), sometimes relevant when calling from special pages
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_QueryPrinter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QueryPrinter.php
@@ -153,7 +153,9 @@
154154 } else {
155155 global $wgTitle;
156156 $popt = new ParserOptions();
157 - $pout = $wgParser->parse($result, $wgTitle, $popt);
 157+ $popt->setEditSection(false);
 158+ $pout = $wgParser->parse($result . '__NOTOC__', $wgTitle, $popt);
 159+ /// NOTE: as of MW 1.14SVN, there is apparently no better way to hide the TOC
158160 $result = $pout->getText();
159161 }
160162 } else {

Status & tagging log