https://bugzilla.wikimedia.org/show_bug.cgi?id=36306

       Web browser: ---
             Bug #: 36306
           Summary: Section toggling broken when h2 section headings span
                    multiple source lines
           Product: MediaWiki extensions
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: MobileFrontend
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected],
                    [email protected]
    Classification: Unclassified
   Mobile Platform: ---


The regex used to detect section headings in MobileFormatter.php does not work
in the event that section headings span multiple lines in the source, which
breaks making the sections toggleable.

Here's the currently existing regex:
<code>
    protected function headingTransform( $s ) {
        wfProfileIn( __METHOD__ );
        $callback = "headingTransformCallback{$this->format}";

        // Closures are a PHP 5.3 feature.
        // MediaWiki currently requires PHP 5.2.3 or higher.
        // So, using old style for now.
        $s = preg_replace_callback(
            '/<h2(.*)<span class="mw-headline" [^>]*>(.+)<\/span>\w*<\/h2>/',
            array( $this, $callback ),
            $s
        );
</code>

This pattern will not work in the event of something like:
<code>
<h2> <span class="mw-headline" id="Sighting">Sighting</span>
</h2>
</code>

We need a less rigid way of detecting section headers.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to