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

--- Comment #2 from Tommi Tuura <[email protected]> 2010-06-04 13:33:08 UTC ---
Here's my hack: in SelectCategoryFunctions.php, lines 260-280:

  # Check linewise for category links:
  $m_isWithinPre = false; # For hack to make this ignore lines including and
between <pre> / <nowiki> tags
  foreach( explode( "\n", $m_pageText ) as $m_textLine ) {
    if (stristr($m_textLine, "<pre>") || stristr($m_textLine, "<nowiki>")) { #
hack
       $m_isWithinPre = true;
    }
    if (!$m_isWithinPre) { # original code
       # Filter line through pattern and store the result:
       $m_cleanText .= preg_replace( "/{$m_pattern}/i", "", $m_textLine ) .
"\n";
       # Check if we have found a category, else proceed with next line:
                   if( !preg_match( "/{$m_pattern}/i", $m_textLine) ) continue;
       # Get the category link from the original text and store it in our list:
       $m_catLinks[ str_replace( ' ', '_', preg_replace( "/.*{$m_pattern}/i",
$m_replace, $m_textLine ) ) ] = true;
    } else { # hack
       $m_cleanText .= $m_textLine . "\n";
    }
    if (stristr($m_textLine, "</pre>") || stristr($m_textLine, "</nowiki>")) {
# hack
       $m_isWithinPre = false;

    }
  }

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
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