Skip to main content

Bug Tracker

Side navigation

#962 closed bug (fixed)

Opened February 15, 2007 10:36AM UTC

Closed March 01, 2007 05:25AM UTC

Last modified June 20, 2007 12:50AM UTC

[PATCH] A fix in clean method

Reported by: sullof@sullof.com Owned by:
Priority: major Milestone: 1.1.3
Component: core Version: 1.1.1
Keywords: Cc:
Blocked by: Blocking:
Description

jQuery 1.1.1 often doesn't preserve white space.

I suggest the following variation to the clean method to preserve white space.

At the line 449 instead of:

var s = jQuery.trim(arg)

I put this:

var s = /^s+</.test(arg) ? jQuery.trim(arg) : arg

So, if arg is a tag string the value is trimmed but if it is pure text the value remains as is.

Attachments (1)
  • patch-962.txt (1.6 KB) - added by john February 26, 2007 11:33PM UTC.

    A patch and test for appending trailing whitespace.

Change History (2)

Changed February 26, 2007 11:32PM UTC by john comment:1

milestone: → 1.1.2
summary: A fix in clean method[PATCH] A fix in clean method
type: enhancementbug
version: → 1.1.1

This has bit me a couple times now. I'm adding a patch which solves this.

Changed March 01, 2007 05:25AM UTC by john comment:2

resolution: → fixed
status: newclosed

Committed in SVN rev [1472].