1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-10-19 17:57:38 +00:00

Update setTiddlerData() to preserve tiddler dictionaries

Previously, data tiddlers were always being saved in JSON format,
regardless of the original format.
This commit is contained in:
Jermolene
2014-02-23 12:33:00 +00:00
parent 823b4fa61b
commit 260080164f
2 changed files with 22 additions and 2 deletions

View File

@@ -436,4 +436,15 @@ exports.base64Decode = function(string64) {
}
};
/*
Convert a hashmap into a tiddler dictionary format sequence of name:value pairs
*/
exports.makeTiddlerDictionary = function(data) {
var output = [];
for(var name in data) {
output.push(name + ": " + data[name]);
}
return output.join("\n");
};
})();