1 message in com.googlegroups.google-gadgets-apiBug: _trim() ignores internal whitespace
FromSent OnAttachments
jl04 Aug 2006 12:53 
Subject:Bug: _trim() ignores internal whitespace
From:jl (mrjo@gmail.com)
Date:08/04/2006 12:53:04 PM
List:com.googlegroups.google-gadgets-api

Contrary to the docs, _trim() doesn't normalize internal whitespace: _trim(" x x ") == ("x x") != ("x x")

The current behavior is quite conventional, so one approach is to call the discrepency a "documentation bug" and strike this line: "Also trims internal repeated whitespace down to a single instance." http://www.google.com/apis/homepage/reference.html#JS_Ref

Here's a code workaround: // Strips whitespace from ends and normalizes internal whitespace function trim__MODULE_ID__(str) {return _trim(str).replace(/\s+/g, " ");}