Yaron Koren has uploaded a new change for review.
https://gerrit.wikimedia.org/r/298303
Change subject: Added 'no html' param to #cargo_query
......................................................................
Added 'no html' param to #cargo_query
Change-Id: I6e3ff99e3b08cdc60066e77427f65786ade4d394
---
M parserfunctions/CargoQuery.php
1 file changed, 9 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo
refs/changes/03/298303/1
diff --git a/parserfunctions/CargoQuery.php b/parserfunctions/CargoQuery.php
index 9fbc563..cd52c7d 100644
--- a/parserfunctions/CargoQuery.php
+++ b/parserfunctions/CargoQuery.php
@@ -27,13 +27,20 @@
$havingStr = null;
$orderByStr = null;
$limitStr = null;
+ $noHTML = false;
$format = 'auto'; // default
$displayParams = array();
foreach ( $params as $param ) {
$parts = explode( '=', $param, 2 );
- if ( count( $parts ) != 2 ) {
+ if ( count( $parts ) == 1 ) {
+ if ( $param == 'no html' ) {
+ $noHTML = true;
+ }
+ continue;
+ }
+ if ( count( $parts ) > 2 ) {
continue;
}
$key = trim( $parts[0] );
@@ -124,7 +131,7 @@
// which means that everything needs to be parsed together
// instead of one instance at a time. Also, the template will
// contain wikitext, not HTML.
- $displayHTML = ( $format != 'template' );
+ $displayHTML = ( !$noHTML && $format != 'template' );
// If there are (seemingly) more results than what we showed,
// show a "View more" link that links to Special:ViewData.
--
To view, visit https://gerrit.wikimedia.org/r/298303
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6e3ff99e3b08cdc60066e77427f65786ade4d394
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits