Adjust magic bolding in api help to only match lines inside *
authorumherirrender <umherirrender_de.wp@web.de>
Thu, 13 Mar 2014 17:55:40 +0000 (18:55 +0100)
committerumherirrender <umherirrender_de.wp@web.de>
Thu, 13 Mar 2014 17:55:40 +0000 (18:55 +0100)
list=logevents&leaction has param values with *, which gets bold, when
there was two of them in the same line.

Bug: 61834
Change-Id: Idace9afd4f3a2dce9be539b209a02fa318df8f45

includes/api/ApiFormatBase.php

index 49a02fe..3c924bc 100644 (file)
@@ -275,8 +275,8 @@ See the <a href='https://www.mediawiki.org/wiki/API'>complete documentation</a>,
                // identify requests to api.php
                $text = preg_replace( '#^(\s*)(api\.php\?[^ <\n\t]+)$#m', '\1<a href="\2">\2</a>', $text );
                if ( $this->mHelp ) {
-                       // make strings inside * bold
-                       $text = preg_replace( "#\\*[^<>\n]+\\*#", '<b>\\0</b>', $text );
+                       // make lines inside * bold
+                       $text = preg_replace( '#^(\s*)(\*[^<>\n]+\*)(\s*)$#m', '$1<b>$2</b>$3', $text );
                }
 
                // Armor links (bug 61362)