Improve canonicalizeHtml to ignore internal Blaze attributes

On IE8, attributes are serialized into innerHTML. Ignore
the $meteor_ui_removal_callbacks attribute that's used
to keep track of callbacks to fire when an element is removed.
This commit is contained in:
Avital Oliver
2014-02-21 19:21:14 -08:00
parent 517da63f41
commit da4d014698

View File

@@ -16,6 +16,10 @@ canonicalizeHtml = function(html) {
attrs = attrs.replace(/sizcache[0-9]+="[^"]*"/g, ' ');
// Similarly for expando properties used by jQuery to track data.
attrs = attrs.replace(/jQuery[0-9]+="[0-9]+"/g, ' ');
// Similarly for expando properties used to DomBackend to keep
// track of callbacks to fire when an element is removed
attrs = attrs.replace(/\$meteor_ui_removal_callbacks="[^"]*"/g, ' ');
attrs = attrs.replace(/\s*=\s*/g, '=');
attrs = attrs.replace(/^\s+/g, '');
attrs = attrs.replace(/\s+$/g, '');