Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F4920
ApiParseTidy.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Authored By
•
bzimport
Nov 21 2014, 10:12 PM
2014-11-21 22:12:06 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
ApiParseTidy.patch
View Options
Index: ApiParse.php
===================================================================
--- ApiParse.php (revision 36096)
+++ ApiParse.php (working copy)
@@ -62,7 +62,10 @@
$this->dieUsage("You don't have permission to view deleted revisions", 'permissiondenied');
$text = $rev->getRawText();
$titleObj = $rev->getTitle();
- $p_result = $wgParser->parse($text, $titleObj, new ParserOptions());
+ $popts = new ParserOptions();
+ $popts->setTidy(true);
+ $popts->enableLimitReport();
+ $p_result = $wgParser->parse($text, $titleObj, $popts);
}
else
{
@@ -77,7 +80,10 @@
$pcache = ParserCache::singleton();
$p_result = $pcache->get($articleObj, $wgUser);
if(!$p_result) {
- $p_result = $wgParser->parse($articleObj->getContent(), $titleObj, new ParserOptions());
+ $popts = new ParserOptions();
+ $popts->setTidy(true);
+ $popts->enableLimitReport();
+ $p_result = $wgParser->parse($articleObj->getContent(), $titleObj, $popts);
global $wgUseParserCache;
if($wgUseParserCache)
$pcache->save($p_result, $articleObj, $wgUser);
@@ -89,7 +95,10 @@
$titleObj = Title::newFromText($title);
if(!$titleObj)
$titleObj = Title::newFromText("API");
- $p_result = $wgParser->parse($text, $titleObj, new ParserOptions());
+ $popts = new ParserOptions();
+ $popts->setTidy(true);
+ $popts->enableLimitReport();
+ $p_result = $wgParser->parse($text, $titleObj, $popts);
}
// Return result
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4484
Default Alt Text
ApiParseTidy.patch (1 KB)
Attached To
Mode
T16471: API parser does not use HTMLTidy on non-cached pages
Attached
Detach File
Event Timeline
Log In to Comment