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

Bawolff <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|auto-insert of whitespace   |auto-insert of non-breaking
                   |                            |whitespace where
                   |                            |appropriate

--- Comment #7 from Bawolff <[email protected]> 2012-07-27 17:35:13 UTC ---
(In reply to comment #6)
> (In reply to comment #5)
> > (Note MW does have some rules for adding nbsp in certain contexts. The rules
> > just aren't all that complex)
> 
> What are they, by the way? I think this is not documented anywhere, but it
> would important to keep it consistent if we add such a new rule.
> Right now I can remember only the separators for digits, used by formatnum,
> which is defined in the MessagesXx files and can be modified only there.
> 
> Moreover, some such rules are defined by the [[International System of Units]]
> itself IIRC, and are not that easy to find, but may be included in some 
> library
> already? The reporter/voters should probably do some investigation.

They're run towards the end of the parsing process (The original proposal in
comment 0 that's linked actually refer to them).

Specificly they are:

 373                 # Clean up special characters, only run once, next-to-last
before doBlockLevels
 374                 $fixtags = array(
 375                         # french spaces, last one Guillemet-left
 376                         # only if there is something before the space
 377                         '/(.) (?=\\?|:|;|!|%|\\302\\273)/' => '\\1&#160;',
 378                         # french spaces, Guillemet-right
 379                         '/(\\302\\253) /' => '\\1&#160;',
 380                         '/&#160;(!\s*important)/' => ' \\1', # Beware of
CSS magic word !important, bug #11874.
 381                 );
 382                 $text = preg_replace( array_keys( $fixtags ),
array_values( $fixtags ), $text );

In english they say:

*If you have a character (any character including spaces), followed by a space,
followed by any of the following characters: ?,:,;,!,% or » (U+BB), the space
gets replaced with a non-breaking space.
*If you have a « (U+AB) followed by a space, that space is replaced by a
non-breaking space.
*As an exception to these rules, if you have a non-breaking space followed by
"!important", the non-breaking space is turned back into a normally breaking
space. This is to prevent messing up CSS style attributes. (This isn't perfect,
there's an open bug somewhere about css styles being messed up by this in edge
cases).

Based on the Guillemet characters, I imagine this is meant for the typing rules
of french.

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