jQuery: The Write Less, Do More JavaScript Library

trim on IE7 ticket

View: New views
7 Messages — Rating Filter:   Alert me  

trim on IE7 ticket

by Ariel Flesler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi

I'd appreciate some help on this ticket: http://dev.jquery.com/ticket/2690

It works well on my IE 7, so there's not much I can do.

Can you please test on your IE7's and post whether it works or not  ?

--
Ariel Flesler
http://flesler.blogspot.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: trim on IE7 ticket

by spicyj :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Broken in Safari for me…

I get:

[ hello world
   ] should be [hello world]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: trim on IE7 ticket

by Ariel Flesler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Use this: http://flesler.webs.com/IE7Trim/

Now I realize it fails.. and even fails on IE6.

--
Ariel Flesler
http://flesler.blogspot.com/

On 3 jul, 20:08, Ariel Flesler <afles...@...> wrote:

> Hi
>
> I'd appreciate some help on this ticket:http://dev.jquery.com/ticket/2690
>
> It works well on my IE 7, so there's not much I can do.
>
> Can you please test on your IE7's and post whether it works or not  ?
>
> --
> Ariel Fleslerhttp://flesler.blogspot.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: trim on IE7 ticket

by markus.staab-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


FF3 worked

IE7 doesn't work

On 4 Jul., 01:26, spicyj <spicyjalap...@...> wrote:
> Broken in Safari for me…
>
> I get:
>
> [ hello world
>    ] should be [hello world]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: trim on IE7 ticket

by Ariel Flesler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I think different browsers, have different interpretations of what the
\s masks.
Thing is.. do we need to worry ?

--
Ariel Flesler
http://flesler.blogspot.com/

On 4 jul, 05:23, "markus.staab" <markus.st...@...> wrote:

> FF3 worked
>
> IE7 doesn't work
>
> On 4 Jul., 01:26, spicyj <spicyjalap...@...> wrote:
>
>
>
> > Broken in Safari for me…
>
> > I get:
>
> > [ hello world
> >    ] should be [hello world]- Ocultar texto de la cita -
>
> - Mostrar texto de la cita -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: trim on IE7 ticket

by spicyj :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


You're right, I think. Apparently Firefox interprets \s as: [1]

[\t\n\v\f\r
\u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a
\u200b\u2028\u2029\u3000]

Replacing \s in either trim implementation by the above makes the test
work in Safari 3/Mac, FF3/Win, IE7/Win, IE6/Win, IE5.5/Win. But is it
worth the trouble?

~spicyj

[1]: http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:RegExp

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: trim on IE7 ticket

by Doug Domeny :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


The specification defines the behavior (see below), so it's not just a
matter of interpretation. This is a defect in IE. The question is how
precise does jQuery wish to be in its adherence to cross-browser
compatibility? Practically, your question is relevant,  do we need to
worry? The cost is a some increase in file size and a little more time
in execution speed--both important factors. As a purist, I would want
it to adhere to spec and be cross-browser equivalent (I've already
changed my copy to be so). As a realist, a compromise would be
acceptable. Common white-space should be properly handled. I found the
defect because non-breaking spaces were ignored. The compromise would
be: [\t\x0b\f\x20\xa0\n\r], thus ignoring the multi-byte white space
characters. I didn't verify the exact interpretation of "\s" for
multiple versions of IE, but perhaps [\s\xa0] or [\s\n\xa0] would also
work.

The appropriate snippets of the spec follow:

        ECMA-262 3rd Edition - December 1999

        15.10.2.12 CharacterClassEscape
        The production CharacterClassEscape :: s evaluates by returning the
set of characters containing the
        characters that are on the right-hand side of the WhiteSpace (7.2) or
LineTerminator (7.3)
        productions.

        7.2 White Space
        \u0009 Tab <TAB>
        \u000B Vertical Tab <VT>
        \u000C Form Feed <FF>
        \u0020 Space <SP>
        \u00A0 No-break space <NBSP>
        Other category “Zs” Any other Unicode
        “space separator”

        7.3 Line Terminator
        \u000A Line Feed <LF>
        \u000D Carriage Return <CR>
        \u2028 Line separator <LS>
        \u2029 Paragraph separator <PS>

        Unicode Regular Expressions http://unicode.org/reports/tr18/
        Unicode Regular Expression Guidelines http://unicode.org/reports/tr18/tr18-6d2.html
        UNICODE CHARACTER DATABASE http://www.unicode.org/Public/UNIDATA/UCD.html
        Revision 5.1.0
        Date 2008-03-25
        http://www.unicode.org/Public/UNIDATA/PropList.txt
        # PropList-5.1.0.txt
        # Date: 2008-03-20, 17:55:27 GMT [MD]
        0020          ; White_Space # Zs       SPACE
        00A0          ; White_Space # Zs       NO-BREAK SPACE
        1680          ; White_Space # Zs       OGHAM SPACE MARK
        180E          ; White_Space # Zs       MONGOLIAN VOWEL SEPARATOR
        2000..200A    ; White_Space # Zs  [11] EN QUAD..HAIR SPACE
        202F          ; White_Space # Zs       NARROW NO-BREAK SPACE
        205F          ; White_Space # Zs       MEDIUM MATHEMATICAL SPACE
        3000          ; White_Space # Zs       IDEOGRAPHIC SPACE

        Reference: http://en.wikipedia.org/wiki/Space_(punctuation)#Table_of_spaces


On Jul 4, 10:16 am, Ariel Flesler <afles...@...> wrote:
> I think different browsers, have different interpretations of what the
> \s masks.
> Thing is.. do we need to worry ?
>
> --
> Ariel Fleslerhttp://flesler.blogspot.com/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---