Trim "template" value in saveWiki()

* Safeguard the code from extraneous whitespaces in transcluded result.
This commit is contained in:
Cindy Ruan 2021-04-02 17:20:04 -07:00
parent fadf6252d4
commit 6cdc80085c

View file

@ -157,8 +157,8 @@ SaverHandler.prototype.saveWiki = function(options) {
return false;
}
var variables = options.variables || {},
template = options.template ||
this.wiki.getTiddlerText("$:/config/SaveWikiButton/Template", "$:/core/save/all"),
template = (options.template ||
this.wiki.getTiddlerText("$:/config/SaveWikiButton/Template", "$:/core/save/all")).trim(),
downloadType = options.downloadType || "text/plain",
text = this.wiki.renderTiddler(downloadType,template,options),
callback = function(err) {