Merge pull request #164 from yanivefraim/develop

Feature #144
This commit is contained in:
Jos de Jong 2015-02-13 09:51:58 +00:00
commit 1a5ea41e77
4 changed files with 24 additions and 4 deletions

View File

@ -24,7 +24,7 @@
*
* @author Jos de Jong, <wjosdejong@gmail.com>
* @version 3.2.0
* @date 2015-01-25
* @date 2015-02-13
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
@ -1481,6 +1481,16 @@ return /******/ (function(modules) { // webpackBootstrap
return $1 + '"' + $2 + '"' + $3;
});
jsonString = jsonString.replace(/\/\*(.|[\r\n])*?\*\//g,'');//Remove all code comments
//If JSON starts with a function (Carachters/digist/"_-"), remove this function.
//This is usefull for "stripping" JSONP objects to become JSON
//For example: function_12321321 ( [{"a":"b"}] ); => [{"a":"b"}]
var match = jsonString.match(/^\s*[\dA-z_$]+\s*\(([\s\S]*)\)\s*;?\s*$/);
if (match) {
var jsonString = match[1];
}
return jsonString;
};

File diff suppressed because one or more lines are too long

4
jsoneditor.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -71,6 +71,16 @@ define(function () {
return $1 + '"' + $2 + '"' + $3;
});
jsonString = jsonString.replace(/\/\*(.|[\r\n])*?\*\//g,'');//Remove all code comments
//If JSON starts with a function (Carachters/digist/"_-"), remove this function.
//This is usefull for "stripping" JSONP objects to become JSON
//For example: function_12321321 ( [{"a":"b"}] ); => [{"a":"b"}]
var match = jsonString.match(/^\s*[\dA-z_$]+\s*\(([\s\S]*)\)\s*;?\s*$/);
if (match) {
var jsonString = match[1];
}
return jsonString;
};