Jackmcbarn has uploaded a new change for review.
https://gerrit.wikimedia.org/r/162123
Change subject: Expose ResourceLoader modules to action=expandtemplates
......................................................................
Expose ResourceLoader modules to action=expandtemplates
Needed by Parsoid to handle things like Babel.
Change-Id: I5c3ccb25385e57633639bb0c7e6f562eb58b05a2
---
M includes/api/ApiExpandTemplates.php
1 file changed, 8 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/23/162123/1
diff --git a/includes/api/ApiExpandTemplates.php
b/includes/api/ApiExpandTemplates.php
index 8a3b534..c0a9491 100644
--- a/includes/api/ApiExpandTemplates.php
+++ b/includes/api/ApiExpandTemplates.php
@@ -126,6 +126,11 @@
if ( isset( $prop['wikitext'] ) ) {
$retval['wikitext'] = $wikitext;
}
+ if ( isset( $prop['rlmodules'] ) ) {
+ $expandedContext = new RequestContext;
+
$expandedContext->getOutput()->addParserOutputMetadata( $wgParser->getOutput()
);
+ $retval['rlmodules'] =
$expandedContext->getOutput()->getModules();
+ }
}
}
$result->setSubelements( $retval, array( 'wikitext',
'parsetree' ) );
@@ -147,6 +152,7 @@
'categories',
'volatile',
'ttl',
+ 'rlmodules',
'parsetree',
),
ApiBase::PARAM_ISMULTI => true,
@@ -172,6 +178,8 @@
'elsewhere within the page',
' ttl - The maximum time after which
caches of the result should be ' .
'invalidated',
+ ' rlmodules - Any ResourceLoader modules that
parser functions have requested ' .
+ 'be added to the output',
' parsetree - The XML parse tree of the input',
'Note that if no values are selected, the
result will contain the wikitext,',
'but the output will be in a deprecated
format.',
--
To view, visit https://gerrit.wikimedia.org/r/162123
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5c3ccb25385e57633639bb0c7e6f562eb58b05a2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Jackmcbarn <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits