Ticket #11827 (closed enhancement: patchwelcome)
jQuery.clean does not support svg elements
|Reported by:||queequac||Owned by:||queequac|
jQuery.clean allows conversion of strings to DOM nodes.
While working with svg snippets and templates, I realized that svg nodes (e.g. rects) were added to the DOM tree, but not rendered. It appeared that the created nodes were invalid elements.
See fiddle for illustration: http://jsfiddle.net/RBHB5/
jQuery.clean creates wrapper elements for tr, td, thead and some more and peels them off afterwards. SVG elements do also require a wrapper (this is: <svg xmlns=" http://www.w3.org/2000/svg"></svg>) for correct instantiation by the browser.
Suggested Solution: Because svg consists of several elements, creating this wrapper for elements with corresponding namespace only would be a sufficent solution instead of adding each single svg element to the existing wrap map. (Further namespaces could be mapped to wrapper elements in the future.) Since it is recommended to use the namespace for svg elements when being used directly in html, this seems to be a good compromise.
Pull request with the fix as well as related unit test will be made after this ticket is created.