/*\ title: $:/core/modules/serializers.js type: application/javascript module-type: tiddlerserializer Functions to serialise tiddlers to a block of text \*/ (function(){ /*jslint node: true, browser: true */ /*global $tw: false */ "use strict"; // Helper function var mapEachTiddler = function(wiki,tiddlers,callback) { var result = []; for(var t=0; t\n
");
		result.push($tw.utils.htmlEncode(tiddler.fields.text));
		result.push("
\n"); return result.join(""); }); }; exports["application/x-tiddler-encrypted-div"] = function(tiddlers) { // Build up the JSON object representing the tiddlers var jsonTiddlers = {}, t, f; for(t=0; t
" + $tw.utils.htmlEncode($tw.crypto.encrypt(JSON.stringify(jsonTiddlers))) + "
"; }; exports["application/x-tiddler-javascript"] = function(tiddlers) { return mapEachTiddler(this,tiddlers,function(tiddler) { return "$tw.preloadTiddler(" + JSON.stringify(tiddler.fields) + ");\n" }); }; })();