Skip to main content

Bug Tracker

Side navigation

#5643 closed bug (fixed)

Opened December 11, 2009 03:48PM UTC

Closed December 11, 2009 10:29PM UTC

$.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:

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

Attachments (0)
Change History (1)

Changed December 11, 2009 10:29PM UTC by dmethvin comment:1

resolution: → fixed
status: newclosed