From 6f7aa650f839e74cf6e5a575990a778d642e12ef Mon Sep 17 00:00:00 2001 From: codedread Date: Wed, 29 Nov 2017 07:52:02 -0800 Subject: [PATCH] Allow data- attributes in the sanitize whitelist. Fixes issue #203. --- editor/sanitize.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/sanitize.js b/editor/sanitize.js index a6d6f9f6..bcbebbbe 100644 --- a/editor/sanitize.js +++ b/editor/sanitize.js @@ -162,7 +162,7 @@ svgedit.sanitize.sanitizeSvg = function(node) { // TODO(codedread): Programmatically add the se: attributes to the NS-aware whitelist. // Bypassing the whitelist to allow se: prefixes. // Is there a more appropriate way to do this? - if (attrName.indexOf('se:') === 0) { + if (attrName.indexOf('se:') === 0 || attrName.indexOf('data-') === 0) { seAttrs.push([attrName, attr.value]); } node.removeAttributeNS(attrNsURI, attrLocalName);