jQuery: The Write Less, Do More JavaScript Library

Ticket #2035 (closed bug: wontfix)

Opened 8 months ago

Last modified 3 months ago

"clean" RegExp fails in Safari 412

Reported by: ajpotts Assigned to: anonymous
Type: bug Priority: major
Milestone: 1.2.4 Component: core
Version: 1.2.1 Keywords:
Cc: Needs: Review

Description (last modified by brandon) (diff)

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

2035.diff (0.6 kB) - added by ebartels 5 months ago.

Change History

Changed 8 months ago by ajpotts

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 8 months ago by brandon

  • description changed from 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. to 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 5 months ago by ebartels

Changed 5 months ago by ebartels

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

Changed 3 months ago by flesler

  • status changed from new to closed
  • resolution set to wontfix
  • milestone changed from 1.2.2 to 1.2.4

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.

Note: See TracTickets for help on using tickets.