diff --git a/src/js/template-loader.js b/src/js/template-loader.js index cc6f5eb96..bfe6a93da 100644 --- a/src/js/template-loader.js +++ b/src/js/template-loader.js @@ -308,7 +308,7 @@ var templateCompiler = function(performanceAwareCaller, templateUrlConverter, te plugins.push(templatesPlugin); // initialize the viewModel object based on the content model. - var viewModel = performanceAwareCaller('initializeViewmodel', initializeViewmodel.bind(this, content, blockModels.blockList, templateUrlConverter, galleryUrl, modelImporter)); + var viewModel = performanceAwareCaller('initializeViewmodel', initializeViewmodel.bind(this, content, blockModels.blockList, templateUrlConverter, galleryUrl, modelImporter, exportCleanedHTML)); viewModel.metadata = metadata; // let's run some version check on template and editor used to build the model being loaded. @@ -367,6 +367,7 @@ var isCompatible = function(detailedException) { }); // Since 0.18 some of our dependencies use block level functions in strict-mode: // They throw a parsing error in IE10 and Safari 8-9 that we previously supported. + /*jslint evil: true */ checkFeature('Block-level functions', function() { try { new Function('\'use strict\'; { function g() { } }'); @@ -406,13 +407,42 @@ var isCompatible = function(detailedException) { } }; -var checkBadBrowserExtensions = function() { - var id = 'checkbadbrowsersframe'; - var origTpl = ko.bindingHandlers.bindIframe.tpl; - ko.bindingHandlers.bindIframe.tpl = "\r\n\r\n
B
\r\n\r\n"; +var cleanUpMap = { + '': '', + ' data-gr-c-s-loaded="true"': '', + '': '', + '': '', +}; + +var cleanUpKnownExtensionsGarbage = function(input) { + for (var search in cleanUpMap) input = input.replace(search, cleanUpMap[search]); + return input; +}; + + +function conditional_restore(html) { + return html.replace(/