merged master
[lhc/web/wiklou.git] / includes / parser / Parser.php
index 9527176..f2b4547 100644 (file)
@@ -4178,7 +4178,7 @@ class Parser {
                        # Don't number the heading if it is the only one (looks silly)
                        if ( count( $matches[3] ) > 1 && $this->mOptions->getNumberHeadings() ) {
                                # the two are different if the line contains a link
-                               $headline = $numbering . ' ' . $headline;
+                               $headline = Html::element( 'span', array( 'class' => 'mw-headline-number' ), $numbering ) . ' ' . $headline;
                        }
 
                        # Create the anchor for linking from the TOC to the section
@@ -4409,7 +4409,7 @@ class Parser {
 
                $p1 = "/\[\[(:?$nc+:|:|)($tc+?)( ?\\($tc+\\))\\|]]/";           # [[ns:page (context)|]]
                $p4 = "/\[\[(:?$nc+:|:|)($tc+?)( ?($tc+))\\|]]/";           # [[ns:page(context)|]]
-               $p3 = "/\[\[(:?$nc+:|:|)($tc+?)( ?\\($tc+\\)|)($tc+|)\\|]]/"; # [[ns:page (context), context|]]
+               $p3 = "/\[\[(:?$nc+:|:|)($tc+?)( ?\\($tc+\\)|)((?:, |,)$tc+|)\\|]]/"; # [[ns:page (context), context|]]
                $p2 = "/\[\[\\|($tc+)]]/";                                      # [[|page]]
 
                # try $p1 first, to turn "[[A, B (C)|]]" into "[[A, B (C)|A, B]]"