Index: trunk/phase3/includes/api/ApiMain.php |
— | — | @@ -317,6 +317,9 @@ |
318 | 318 | |
319 | 319 | if ($this->mPrinter->getNeedsRawData()) |
320 | 320 | $this->getResult()->setRawMode(); |
| 321 | + |
| 322 | + if( $this->mAction == 'help' ) |
| 323 | + $this->mPrinter->setHelp(); |
321 | 324 | } |
322 | 325 | |
323 | 326 | // Execute |
Index: trunk/phase3/includes/api/ApiFormatBase.php |
— | — | @@ -35,7 +35,7 @@ |
36 | 36 | */ |
37 | 37 | abstract class ApiFormatBase extends ApiBase { |
38 | 38 | |
39 | | - private $mIsHtml, $mFormat, $mUnescapeAmps; |
| 39 | + private $mIsHtml, $mFormat, $mUnescapeAmps, $mHelp; |
40 | 40 | |
41 | 41 | /** |
42 | 42 | * Create a new instance of the formatter. |
— | — | @@ -170,6 +170,13 @@ |
171 | 171 | } |
172 | 172 | |
173 | 173 | /** |
| 174 | + * Says pretty-printer that it should use *bold* and $italics$ formatting |
| 175 | + */ |
| 176 | + public function setHelp( $help = true ) { |
| 177 | + $this->mHelp = true; |
| 178 | + } |
| 179 | + |
| 180 | + /** |
174 | 181 | * Prety-print various elements in HTML format, such as xml tags and URLs. |
175 | 182 | * This method also replaces any '<' with < |
176 | 183 | */ |
— | — | @@ -184,10 +191,12 @@ |
185 | 192 | $text = ereg_replace("($protos)://[^ \\'\"()<\n]+", '<a href="\\0">\\0</a>', $text); |
186 | 193 | // identify requests to api.php |
187 | 194 | $text = ereg_replace("api\\.php\\?[^ \\()<\n\t]+", '<a href="\\0">\\0</a>', $text); |
188 | | - // make strings inside * bold |
189 | | - $text = ereg_replace("\\*[^<>\n]+\\*", '<b>\\0</b>', $text); |
190 | | - // make strings inside $ italic |
191 | | - $text = ereg_replace("\\$[^<>\n]+\\$", '<b><i>\\0</i></b>', $text); |
| 195 | + if( $this->mHelp ) { |
| 196 | + // make strings inside * bold |
| 197 | + $text = ereg_replace("\\*[^<>\n]+\\*", '<b>\\0</b>', $text); |
| 198 | + // make strings inside $ italic |
| 199 | + $text = ereg_replace("\\$[^<>\n]+\\$", '<b><i>\\0</i></b>', $text); |
| 200 | + } |
192 | 201 | |
193 | 202 | /* Temporary fix for bad links in help messages. As a special case, |
194 | 203 | * XML-escaped metachars are de-escaped one level in the help message |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -313,6 +313,7 @@ |
314 | 314 | * Add action=parse to render parser output. Use it instead of action=render which is deprecated. |
315 | 315 | * Add rvtoken=rollback to prop=revisions |
316 | 316 | * Add meta=allmessages to get messages from site's messages cache. |
| 317 | +* Use bold and italics highlighting only in API help |
317 | 318 | |
318 | 319 | === Languages updated in 1.12 === |
319 | 320 | |