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

           Summary: Don't add &nbsp; in <pre>
           Product: MediaWiki
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: Normal
         Component: Page rendering
        AssignedTo: [email protected]
        ReportedBy: [email protected]


We had a user cut and paste a template from our mediawiki installation end up
with some strange non-space invisible characters today.  We think the cut and
paste is a bit obscure.  (He's using vimperator on firefox and that seems to
have been part of how this happens).  However, looking at what caused the
special characters we found that mediawiki is adding &nbsp; if it's preceded
with certain special characters.  This happens even if the text occurs in a
<pre> tag which seem redundant in most cases and, in this case, leads to the
cut and paste bug we observed.

The following code seems to be causing this:

from Parser::parse():

# Clean up special characters, only run once, next-to-last before doBlockLevels
$fixtags = array(
        # french spaces, last one Guillemet-left
        # only if there is something before the space
        '/(.) (?=\\?|:|;|!|%|\\302\\273)/' => '\\1&nbsp;\\2',
        # french spaces, Guillemet-right
        '/(\\302\\253) /' => '\\1&nbsp;',
        '/&nbsp;(!\s*important)/' => ' \\1', #Beware of CSS magic word
!important, bug #11874.
);

It would be great if this code was smart enough to not replace spaces with
&nbsp; inside of a <pre>.


-- 
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