Skip to main content

Bug Tracker

Side navigation

#2035 closed bug (wontfix)

Opened December 10, 2007 06:40PM UTC

Closed May 16, 2008 07:32PM UTC

"clean" RegExp fails in Safari 412

Reported by: ajpotts Owned by:
Priority: major Milestone: 1.2.4
Component: core Version: 1.2.1
Keywords: Cc:
Blocked by: Blocking:
Description

This line

elem = elem.replace(/(<(\\w+)[^>]*?)\\/>/g, function(all, front, tag){...

will fail in Safari 2.0 build 412 (and presumably before). Safari doesn't see the end of the regex at all, and so pretty much everything goes wrong.

Quick fix:

elem = elem.replace(new RegExp("(<(\\w+)[^>]*?)\\/>"), function(all, front, tag){ ...

Obviously early Safari has a problem with parsing RegExps in the /.../g style, but I haven't found any other problems yet.

Attachments (1)
  • 2035.diff (0.6 KB) - added by ebartels March 12, 2008 10:00PM UTC.
Change History (4)

Changed December 10, 2007 07:47PM UTC by ajpotts comment:1

Sorry, didn't spot the browser compatibility change to 2.0.2.

For what it's worth, 2.0 test suite errors are largely confined to unicode selectors. Still, this fix is valid for anyone who cares. Allows thickbox amongst others to work fine.

Changed December 14, 2007 03:59PM UTC by brandon comment:2

description: This line \ \ elem = elem.replace(/(<(\\w+)[^>]*?)\\/>/g, function(all, front, tag){... \ \ will fail in Safari 2.0 build 412 (and presumably before). Safari doesn't see the end of the regex at all, and so pretty much everything goes wrong. \ \ Quick fix: \ \ elem = elem.replace(new RegExp("(<(\\w+)[^>]*?)\\/>"), function(all, front, tag){ ... \ \ Obviously early Safari has a problem with parsing RegExps in the /.../g style, but I haven't found any other problems yet. \ \ This line \ \ {{{elem = elem.replace(/(<(\\w+)[^>]*?)\\/>/g, function(all, front, tag){...}}} \ \ will fail in Safari 2.0 build 412 (and presumably before). Safari doesn't see the end of the regex at all, and so pretty much everything goes wrong. \ \ Quick fix: \ \ {{{elem = elem.replace(new RegExp("(<(\\w+)[^>]*?)\\/>"), function(all, front, tag){ ...}}} \ \ Obviously early Safari has a problem with parsing RegExps in the /.../g style, but I haven't found any other problems yet. \ \

Changed March 12, 2008 10:05PM UTC by ebartels comment:3

This seems to fix a lot of Safari 2 issues with appending/inserting content.

Changed May 16, 2008 07:32PM UTC by flesler comment:4

milestone: 1.2.21.2.4
resolution: → wontfix
status: newclosed

That is a very old version of Safari.. and not supported.

There's no point in fixing this, that kind of regexps take more time to process, and that function is called a lot.

Closing as invalid.