From da4d0146988a45f7bf44406242ef2d054016a577 Mon Sep 17 00:00:00 2001 From: Avital Oliver Date: Fri, 21 Feb 2014 19:21:14 -0800 Subject: [PATCH] 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. --- packages/test-helpers/canonicalize_html.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/test-helpers/canonicalize_html.js b/packages/test-helpers/canonicalize_html.js index f4869b7487..73db66ecda 100644 --- a/packages/test-helpers/canonicalize_html.js +++ b/packages/test-helpers/canonicalize_html.js @@ -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, '');