From b90600580f4eca21690eeb47dc4e72a2de2ec82a Mon Sep 17 00:00:00 2001 From: Jermolene Date: Fri, 24 Feb 2017 15:36:22 +0000 Subject: [PATCH] Filesystemadaptor: Fix bug with JSON tiddlers Fixes #2783 --- plugins/tiddlywiki/filesystem/filesystemadaptor.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/tiddlywiki/filesystem/filesystemadaptor.js b/plugins/tiddlywiki/filesystem/filesystemadaptor.js index 379d11ea0..bcbb687ff 100644 --- a/plugins/tiddlywiki/filesystem/filesystemadaptor.js +++ b/plugins/tiddlywiki/filesystem/filesystemadaptor.js @@ -64,7 +64,10 @@ FileSystemAdaptor.prototype.getTiddlerFileInfo = function(tiddler,callback) { fileInfo.type = ($tw.config.fileExtensionInfo[extension] || {type: "application/x-tiddler"}).type; // Use a .meta file unless we're saving a .tid file. // (We would need more complex logic if we supported other template rendered tiddlers besides .tid) - fileInfo.hasMetaFile = (fileInfo.type !== "application/x-tiddler"); + fileInfo.hasMetaFile = (fileInfo.type !== "application/x-tiddler") && (fileInfo.type !== "application/json"); + if(!fileInfo.hasMetaFile) { + extension = ".tid"; + } // Generate the base filepath and ensure the directories exist var baseFilepath = path.resolve($tw.boot.wikiTiddlersPath,this.generateTiddlerBaseFilepath(title)); $tw.utils.createFileDirectories(baseFilepath);