mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-12-02 23:08:06 +00:00
Add support for JSON files containing a single tiddler
At the moment, we support JSON files containing an array of tiddlers. With this change the core will import files containing a single tiddler. Also adding templates for saving individual tiddlers in JSON format
This commit is contained in:
@@ -1320,8 +1320,8 @@ $tw.modules.define("$:/boot/tiddlerdeserializer/html","tiddlerdeserializer",{
|
||||
});
|
||||
$tw.modules.define("$:/boot/tiddlerdeserializer/json","tiddlerdeserializer",{
|
||||
"application/json": function(text,fields) {
|
||||
var tiddlers = JSON.parse(text);
|
||||
return tiddlers;
|
||||
var data = JSON.parse(text);
|
||||
return $tw.utils.isArray(data) ? data : [data];
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user