From 2c1172df21dad1d2358809728719f58051c678ad Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Fri, 28 Nov 2014 15:08:08 +0200 Subject: [PATCH] Support non-JSON script attributes --- lib/less-browser/utils.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/less-browser/utils.js b/lib/less-browser/utils.js index e7439535..7a645b1b 100644 --- a/lib/less-browser/utils.js +++ b/lib/less-browser/utils.js @@ -13,7 +13,10 @@ module.exports = { if (opt === "env" || opt === "dumpLineNumbers" || opt === "rootpath" || opt === "errorReporting") { options[opt] = tag.dataset[opt]; } else { - options[opt] = JSON.parse(tag.dataset[opt]); + try { + options[opt] = JSON.parse(tag.dataset[opt]); + } + catch(_) {} } } }