From c45f4d1c626c63a1ed718d759b94727de84b12ea Mon Sep 17 00:00:00 2001 From: natecain Date: Tue, 17 Sep 2013 15:15:38 -0400 Subject: [PATCH] Small revision to previous commit, avoids double encoding. We don't need to encodeURIComponent at all when using blob links. The data never goes into the dom directly, just a guid reference. This makes saving with blobs very fast! --- core/modules/savers/download.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/modules/savers/download.js b/core/modules/savers/download.js index d0d7e6989..7e10e188d 100644 --- a/core/modules/savers/download.js +++ b/core/modules/savers/download.js @@ -29,7 +29,7 @@ DownloadSaver.prototype.save = function(text) { var link = document.createElement("a"); link.setAttribute("target","_blank"); if(Blob != undefined) { - var blob = new Blob([encodeURIComponent(text)], {type: "text/html"}); + var blob = new Blob([text], {type: "text/html"}); link.setAttribute("href", URL.createObjectURL(blob)); } else { link.setAttribute("href","data:text/html," + encodeURIComponent(text));