Skip to content
This repository has been archived by the owner on Jul 25, 2021. It is now read-only.

Commit

Permalink
Unescape html when adding to an existing button
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Wilson committed Jan 7, 2017
1 parent bb21811 commit 1121f03
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dist/js/tableexport.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,11 @@
}
}

function unescapeHtml(string) {
var doc = new DOMParser().parseFromString(string, "text/html");
return doc.documentElement.textContent;
}

function checkCaption(exportButton) {
var $caption = $el.find('caption:not(.head)');
$caption.length ? $caption.append(exportButton) : $el.prepend('<caption class="' + bootstrapSpacing + self.settings.position + '">' + exportButton + '</caption>');
Expand All @@ -312,7 +317,7 @@

function attachExportToButton(dataObject, target) {
var exportButton = $(target);
exportButton.attr('data-fileblob', dataObject)
exportButton.attr('data-fileblob', unescapeHtml(dataObject));
}
});

Expand Down

0 comments on commit 1121f03

Please sign in to comment.