1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-01-23 23:46:52 +00:00

Fixed wiki.saveWiki to pass the correct parameters to the template

This commit is contained in:
Jeremy Ruston 2012-08-25 17:32:43 +01:00
parent c45b0a7641
commit 389b6513b6
3 changed files with 7 additions and 2 deletions

View File

@ -579,7 +579,8 @@ exports.callSaver = function(method /*, args */ ) {
};
/*
Save the wiki contents
Save the wiki contents. Options are:
saveEmpty: causes the wiki to be saved without any content
template: the tiddler containing the template to save
downloadType: the content type for the saved file
*/
@ -587,7 +588,11 @@ exports.saveWiki = function(options) {
options = options || {};
var template = options.template || "$:/core/templates/tiddlywiki5.template.html",
downloadType = options.downloadType || "text/plain",
text = this.renderTiddler(downloadType,template);
renderOptions = {};
renderOptions["with"] = options.saveEmpty ?
[undefined,"[!is[shadow]is[shadow]]"] :
[undefined,"[!is[shadow]]"];
var text = this.renderTiddler(downloadType,template,renderOptions);
this.callSaver("save",text);
};