Modify ↓
Ticket #5643 (closed bug: fixed)
$.trim() in jQuery 1.4a1 strips out embedded newlines
| Reported by: | JeremyRuston | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.4 |
| Component: | unfiled | Version: | 1.4a1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
I think the regexp for $.trim() has been broken. It seems to remove all white space, not just that at the start and end.
The old code was:
return (text || "").replace( /^\s+|\s+$/g, "" );
The equivalent regexp in the new code is:
rtrim = /(\s|\u00A0)+|(\s|\u00A0)+$/g,
It looks like we've lost a caret
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

Fixed in github at http://github.com/jquery/jquery/commit/abbd2f4c3c93d9550cea81ccd6d6187c115eeb56