The .clean() method tries to replace empty elements defined as <elem /> with
<elem></elem>.  Here's the code from .clean():

   // 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 + ">";
      });

If the element is namespaced like this:
   <data:person name="john doe" id="123" />
the manufactured closing tag is incorrect:
   <data:person name="john doe" id="123" ></data>

Changing the regular expression's (\w+) to ([A-Za-z0-9_:]+) fixes the
problem.  

-- 
View this message in context: 
http://www.nabble.com/jQuery-1.2.X%27s-.clean%28%29-mangles-namespaced-elements-tp19151160s27240p19151160.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

Reply via email to