From c5ced798e815e19ccb7ab6d2db420cfa1825f901 Mon Sep 17 00:00:00 2001 From: Jan Date: Fri, 13 Feb 2015 11:59:05 +0100 Subject: [PATCH 1/2] Update SVGExport.js --- src/svg/SVGExport.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/svg/SVGExport.js b/src/svg/SVGExport.js index 1aed2571..9ac38788 100644 --- a/src/svg/SVGExport.js +++ b/src/svg/SVGExport.js @@ -387,7 +387,7 @@ new function() { if (onExport) node = onExport(item, node, options) || node; var data = JSON.stringify(item._data); - if (data && data !== '{}') + if (data && data !== '{}' && data != 'null') node.setAttribute('data-paper-data', data); } return node && applyStyle(item, node, isRoot); From 1d8c662c984841922208dd3e84cc378e245a7917 Mon Sep 17 00:00:00 2001 From: Jan Date: Fri, 13 Feb 2015 12:10:47 +0100 Subject: [PATCH 2/2] Update SVGExport.js Check for `'null'` before setting custom paper data attribute, because `JSON.stringify()` returns `"null"` (as a String object) if the argument is null. --- src/svg/SVGExport.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/svg/SVGExport.js b/src/svg/SVGExport.js index 9ac38788..cdc706fe 100644 --- a/src/svg/SVGExport.js +++ b/src/svg/SVGExport.js @@ -387,7 +387,7 @@ new function() { if (onExport) node = onExport(item, node, options) || node; var data = JSON.stringify(item._data); - if (data && data !== '{}' && data != 'null') + if (data && data !== '{}' && data !== 'null') node.setAttribute('data-paper-data', data); } return node && applyStyle(item, node, isRoot);