mirror of
https://github.com/Jermolene/TiddlyWiki5.git
synced 2026-04-27 07:40:52 -07: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:
parent
d65fd771e7
commit
779e62a30f
5 changed files with 72 additions and 11 deletions
|
|
@ -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];
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue