From 951c53c982d8d4fb0abd2ab8758a9dbcc3603911 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Sun, 18 Nov 2012 14:57:54 +0000 Subject: [PATCH] Do some content type jiggling with TiddlyWeb To be fixed up later --- plugins/tiddlywiki/tiddlyweb/tiddlyweb.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/tiddlywiki/tiddlyweb/tiddlyweb.js b/plugins/tiddlywiki/tiddlyweb/tiddlyweb.js index 2481a8ce9..b6b832898 100644 --- a/plugins/tiddlywiki/tiddlyweb/tiddlyweb.js +++ b/plugins/tiddlywiki/tiddlyweb/tiddlyweb.js @@ -202,6 +202,7 @@ Convert a TiddlyWeb JSON tiddler into a TiddlyWiki5 tiddler */ TiddlyWebSyncer.prototype.convertTiddler = function(tiddlerFields) { var result = {}; + // Transfer the fields, pulling down the `fields` hashmap for(var f in tiddlerFields) { switch(f) { case "fields": @@ -214,6 +215,12 @@ TiddlyWebSyncer.prototype.convertTiddler = function(tiddlerFields) { break; } } + // Some unholy freaking of content types + if(result.type === "text/javascript") { + result.type = "application/javascript"; + } else if(!result.type || result.type === "None") { + result.type = "text/x-tiddlywiki-old"; + } return result; };