Bug Tracker

Modify

Ticket #1620 (closed bug: invalid)

Opened 6 years ago

Last modified 6 years ago

clean: function

Reported by: sburton Owned by:
Priority: trivial Milestone: 1.2.1
Component: core Version: 1.2
Keywords: Cc: sburton@…
Blocking: Blocked by:

Description

I am new to jQuery, but came across an issue in the clear: function.

Where jQuery trim whitespace it trims and lower-cases the entire arg where it looks like it only needs to lower-case the html tags. We just removed the jQuery.trim(arg).toLowerCase(),... to jQuery.trim(arg),... but I think it is safer to lower-case the tags. Maybe just lower case within side the tags.

var s = jQuery.trim(arg).replace(/<.*?>/g, "$0"), div = doc.createElement("div"), tb = [];

instead of

var s = jQuery.trim(arg).toLowerCase(), div = doc.createElement("div"), tb = [];

or something of that affect without removing the .toLowerCase() function.

Change History

comment:1 Changed 6 years ago by john

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

I think there's some confusion - that string "s" - is ONLY used for comparison. You'll not that we leave the original 'arg' variable intact and insert that directly into the document. Thanks for your thoughts, though - and welcome to jQuery!

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.