Opened 13 years ago
Closed 13 years ago
#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: | ||
Blocked by: | Blocking: |
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
Note: See
TracTickets for help on using
tickets.
Fixed in github at http://github.com/jquery/jquery/commit/abbd2f4c3c93d9550cea81ccd6d6187c115eeb56