Bug Tracker

Opened 10 years ago

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

Change History (1)

comment:1 Changed 10 years ago by dmethvin

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.