Skip to main content

Bug Tracker

Side navigation

Ticket #2604: clean-comments.diff


File clean-comments.diff, 1.0 KB (added by flesler, May 15, 2008 01:50PM UTC)

This should fix this, but breaks 3 tests. I'll postpone this for now.. we have more critical tickets and we're close to a release.

Index: core.js
===================================================================
--- core.js	(revision 5604)
+++ core.js	(working copy)
@@ -949,12 +949,16 @@
 
 			// Convert html string into DOM nodes
 			if ( typeof elem == "string" ) {
-				// Fix "XHTML"-style tags in all browsers
-				elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){
-					return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?
-						all :
-						front + "></" + tag + ">";
-				});
+				
+				elem = elem
+					// Remove comment nodes
+					.replace(/<!--.*?-->/g, "")
+					// Fix "XHTML"-style tags in all browsers
+					.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){
+						return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?
+							all :
+							front + "></" + tag + ">";
+					});
 
 				// Trim whitespace, otherwise indexOf won't work as expected
 				var tags = jQuery.trim( elem ).toLowerCase(), div = context.createElement("div");

Download in other formats:

Original Format