Skip to content

Commit a15dfe2

Browse files
committed
Merge branch 'master' of https://github.com/pittborndigital/patternlab-node into pittborndigital-master
2 parents e8f2e8a + ca6721c commit a15dfe2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

core/lib/parameter_hunter.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ var parameter_hunter = function () {
6262
var values = [];
6363
var wrapper;
6464

65+
// attempt to parse the data incase it is already well formed JSON
66+
try {
67+
paramStringWellFormed = JSON.stringify(JSON.parse(pString));
68+
return paramStringWellFormed;
69+
} catch(err) {
70+
console.log('Not valid JSON - will attempt to parse manually...');
71+
}
72+
6573
//replace all escaped double-quotes with escaped unicode
6674
paramString = paramString.replace(/\\"/g, '\\u0022');
6775

0 commit comments

Comments
 (0)