From a4506231a70941041e421d24810339ba5bfb9b43 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Thu, 14 Jul 2016 17:42:57 +0100 Subject: [PATCH] Fix writing non-wikitext text tiddlers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The plan had been to switch template depending on the content type, but we’d only implemented support for saving wikitext tiddlers. That meant that creating a tiddler with any non-wikitext content type failed to write the file correctly under Node.js. Now we just always save in .tid file format. --- plugins/tiddlywiki/filesystem/filesystemadaptor.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/plugins/tiddlywiki/filesystem/filesystemadaptor.js b/plugins/tiddlywiki/filesystem/filesystemadaptor.js index c6c661316..94312fd7f 100644 --- a/plugins/tiddlywiki/filesystem/filesystemadaptor.js +++ b/plugins/tiddlywiki/filesystem/filesystemadaptor.js @@ -40,10 +40,6 @@ $tw.config.typeInfo = { } }; -$tw.config.typeTemplates = { - "application/x-tiddler": "$:/core/templates/tid-tiddler" -}; - FileSystemAdaptor.prototype.getTiddlerFileInfo = function(tiddler,callback) { // See if we've already got information about this file var self = this, @@ -178,8 +174,7 @@ FileSystemAdaptor.prototype.saveTiddler = function(tiddler,callback) { }); } else { // Save the tiddler as a self contained templated file - template = $tw.config.typeTemplates[fileInfo.type]; - content = self.wiki.renderTiddler("text/plain",template,{variables: {currentTiddler: tiddler.fields.title}}); + content = self.wiki.renderTiddler("text/plain","$:/core/templates/tid-tiddler",{variables: {currentTiddler: tiddler.fields.title}}); fs.writeFile(fileInfo.filepath,content,{encoding: "utf8"},function (err) { if(err) { return callback(err);