Ticket #2034 (closed bug: fixed)
OpenLayers.String.trim() fails to trim trailing whitespace on multi-line strings
| Reported by: | etdube | Owned by: | tschaub |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.8 Release |
| Component: | BaseTypes | Version: | 2.7 |
| Keywords: | Cc: | ||
| State: | Complete |
Description
Test case:
var str = "chicken\nHead "; var trimmed = OpenLayers.String.trim(str); // trimmed = "chicken\nHead " ... wrong!
Attached patch replaces the trim regex with the 1st listed at http://blog.stevenlevithan.com/archives/faster-trim-javascript , which is working for this case and should be efficient enough. Also updates tests/BaseTypes.html with a new testcase.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

