moved trailingWhitespace function to MobileHTMLUitl