Skip to main content

Bug Tracker

Side navigation

#13476 closed bug (duplicate)

Opened February 19, 2013 06:48PM UTC

Closed February 19, 2013 07:36PM UTC

Sizzle fails due to untrimmed whitespace

Reported by: NiX Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.9.1
Keywords: Cc:
Blocked by: Blocking:
Description

Code below will fail due to white space in the beginning of the string:

$("\\n<div/>");

Same goes for \\t and \\r. That's all I tried so far.

My original code had a multiline string with HTML code but the example above is essentially the same thing.

It looks like this bug was introduced in 1.9.0

I tracked it down to the regex in rquickExpr

In 1.8.3 it was

rquickExpr = /^(?:[^#<]*(<[\\w\\W]+>)[^>]*$|#([\\w\\-]*)$)/,

and in 1.9.0 it became

rquickExpr = /^(?:(<[\\w\\W]+>)[^>]*|#([\\w-]*))$/
Attachments (0)
Change History (1)

Changed February 19, 2013 07:36PM UTC by dmethvin comment:1

resolution: → duplicate
status: newclosed

Duplicate of #13223.The jQuery Migrate plugin should have warned you about this, were you using it?

https://github.com/jquery/jquery-migrate/blob/master/warnings.md#jqmigrate-html-html-strings-must-start-with--character