mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-12-09 02:08:05 +00:00
jsonset: add support for assigning JSON strings
This commit is contained in:
@@ -75,7 +75,7 @@ exports["jsonset"] = function(source,operator,options) {
|
||||
value = operator.operands[operator.operands.length - 1],
|
||||
results = [];
|
||||
if(operator.operands.length === 1 && operator.operands[0] === "") {
|
||||
value = undefined;
|
||||
value = undefined; // Prevents the value from being assigned
|
||||
}
|
||||
switch(type) {
|
||||
case "string":
|
||||
@@ -99,6 +99,9 @@ exports["jsonset"] = function(source,operator,options) {
|
||||
indexes = operator.operands;
|
||||
value = null;
|
||||
break;
|
||||
case "json":
|
||||
value = $tw.utils.parseJSONSafe(value,function() {return undefined;});
|
||||
break;
|
||||
default:
|
||||
// Use value unchanged
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user