Filesystemadaptor: Fix bug with JSON tiddlers

Fixes 
print-window-tiddler
Jermolene 2017-02-24 15:36:22 +00:00
rodzic d0594e4a45
commit b90600580f
1 zmienionych plików z 4 dodań i 1 usunięć
plugins/tiddlywiki/filesystem

Wyświetl plik

@ -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);