r79313 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79312‎ | r79313 | r79314 >
Date:02:13, 31 December 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Add comment to wikitext output to indicate it's auto-generated
Modified paths:
  • /trunk/extensions/Validator/Validator.i18n.php (modified) (history)
  • /trunk/extensions/Validator/includes/parserHooks/Validator_Describe.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Validator/includes/parserHooks/Validator_Describe.php
@@ -138,9 +138,14 @@
139139 $description =
140140 ( $parameters['pre'] ? '== ' : '<h2>' ) .
141141 $hookName .
142 - ( $parameters['pre'] ? ' ==' : '</h2>' ) . "\n\n";
143 -
 142+ ( $parameters['pre'] ? ' ==' : '</h2>' );
144143
 144+ if ( $parameters['pre'] ) {
 145+ $description .= "\n<!-- " . wfMsg( 'validator-describe-autogen' ) . ' -->';
 146+ }
 147+
 148+ $description .= "\n\n";
 149+
145150 if ( $descriptionData['description'] !== false ) {
146151 $description .= wfMsgExt( 'validator-describe-descriptionmsg', 'parsemag', $descriptionData['description'] );
147152 $description .= "\n\n";
@@ -257,6 +262,7 @@
258263
259264 $result .= "'''" . wfMsg( 'validator-describe-tagmax' ) . "'''\n\n";
260265
 266+ // TODO: multiline when long
261267 $result .= "<pre!><nowiki>\n" . Xml::element(
262268 $hookName,
263269 $params
Index: trunk/extensions/Validator/Validator.i18n.php
@@ -75,6 +75,7 @@
7676 'validator-describe-pfmin' => 'Parser function with only the required parameters.',
7777 'validator-describe-pfmax' => 'Parser function with all parameters.',
7878 'validator-describe-pfdefault' => 'Parser function with all parameters using the default parameter notation.',
 79+ 'validator-describe-autogen' => 'The contents of this section was auto-generated by the "describe" parser hook of the Validator extension.',
7980
8081 // Criteria errors for single values
8182 'validator_error_empty_argument' => 'Parameter $1 can not have an empty value.',

Status & tagging log