Bug Tracker

Modify

Ticket #5720 (closed bug: duplicate)

Opened 3 years ago

Last modified 3 years ago

`expando` cleanup in `.html()` and `.clone()` is too greedy

Reported by: maranomynet Owned by:
Priority: major Milestone: 1.4
Component: unfiled Version: 1.3.2
Keywords: Cc:
Blocking: Blocked by:

Description

There's a bug in the rinlinejQuery regexp that makes it a bit too "greedy":

jQuery('<p> jQuery12="0" </p>').html();  // returns: "  "

Proposed fix:

In manipulation.js,  line 1 should be changed to something like:

var rinlinejQuery = /(<\w[^<]+) jQuery\d+="(?:\d+|null)"/g,
                     ^^^^^^^^^^

and the replacements in lines  156 and  176 to reinsert the first matching parenthesis:

.replace(rinlinejQuery, "$1")
                        ^^^^

Actually this whole rinlinejQuery business is a bit of an ugly hack. Would it perhaps be feasible to fix the expando value in a way similar to what Andrea Giammarchi suggests in  this jquery-dev post?

Change History

comment:1 Changed 3 years ago by maranomynet

Ack! this ticket was meant for jQuery 1.4a2

comment:2 Changed 3 years ago by maranomynet

reposted as #5729

comment:3 Changed 3 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to duplicate

Replaced by #5729.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.