From 6864251962d70a597dff6a79d02a017007a1badd Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Mon, 13 May 2013 17:42:07 +0100 Subject: [PATCH] Cleaning up content types Dealt with some inconsistencies --- boot/boot.js | 2 +- core/modules/deserializers.js | 6 +++--- core/modules/parsers/textparser.js | 2 +- editions/tw5tiddlyweb/tiddlers/system/SiteSubtitle.tid | 1 - editions/tw5tiddlyweb/tiddlers/system/SiteTitle.tid | 1 - plugins/tiddlywiki/loadrecipe/recipe.js | 2 +- 6 files changed, 6 insertions(+), 8 deletions(-) diff --git a/boot/boot.js b/boot/boot.js index 4ac68988f..e300ddc2c 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -1224,7 +1224,7 @@ $tw.boot.startup = function() { $tw.utils.registerFileType("text/vnd.tiddlywiki","utf8",".tid"); $tw.utils.registerFileType("application/x-tiddler","utf8",".tid"); $tw.utils.registerFileType("application/x-tiddler-html-div","utf8",".tiddler"); - $tw.utils.registerFileType("application/vnd.tiddlywiki2-recipe","utf8",".recipe"); + $tw.utils.registerFileType("text/vnd.tiddlywiki2-recipe","utf8",".recipe"); $tw.utils.registerFileType("text/plain","utf8",".txt"); $tw.utils.registerFileType("text/css","utf8",".css"); $tw.utils.registerFileType("text/html","utf8",".html"); diff --git a/core/modules/deserializers.js b/core/modules/deserializers.js index 1bdb2cbf4..979f58c2e 100644 --- a/core/modules/deserializers.js +++ b/core/modules/deserializers.js @@ -86,8 +86,8 @@ exports["application/json"] = function(text,fields) { /* Parse an HTML file into tiddlers. There are three possibilities: -# A TiddlyWiki classic HTML file containing `application/vnd.tiddlywiki2` tiddlers -# A TiddlyWiki5 HTML file containing `application/vnd.tiddlywiki` tiddlers +# A TiddlyWiki classic HTML file containing `text/vnd.tiddlywiki2` tiddlers +# A TiddlyWiki5 HTML file containing `text/vnd.tiddlywiki` tiddlers # An ordinary HTML file */ exports["text/html"] = function(text,fields) { @@ -117,7 +117,7 @@ function deserializeTiddlyWikiFile(text,storeAreaEnd,isTiddlyWiki5,fields) { var results = [], endOfDivRegExp = /(<\/div>\s*)/gi, startPos = storeAreaEnd, - defaultType = isTiddlyWiki5 ? "application/vnd.tiddlywiki": "application/vnd.tiddlywiki2"; + defaultType = isTiddlyWiki5 ? "text/vnd.tiddlywiki": "text/vnd.tiddlywiki2"; endOfDivRegExp.lastIndex = startPos; var match = endOfDivRegExp.exec(text); while(match) { diff --git a/core/modules/parsers/textparser.js b/core/modules/parsers/textparser.js index 053cd2864..968c87c67 100644 --- a/core/modules/parsers/textparser.js +++ b/core/modules/parsers/textparser.js @@ -24,7 +24,7 @@ var TextParser = function(type,text,options) { }; exports["text/plain"] = TextParser; -exports["application/vnd.tiddlywiki2"] = TextParser; +exports["text/vnd.tiddlywiki2"] = TextParser; exports["application/javascript"] = TextParser; exports["application/json"] = TextParser; exports["text/css"] = TextParser; diff --git a/editions/tw5tiddlyweb/tiddlers/system/SiteSubtitle.tid b/editions/tw5tiddlyweb/tiddlers/system/SiteSubtitle.tid index a4c5a861c..c28ad35ee 100644 --- a/editions/tw5tiddlyweb/tiddlers/system/SiteSubtitle.tid +++ b/editions/tw5tiddlyweb/tiddlers/system/SiteSubtitle.tid @@ -1,4 +1,3 @@ title: SiteSubtitle -type: application/x-tiddler for TiddlyWeb \ No newline at end of file diff --git a/editions/tw5tiddlyweb/tiddlers/system/SiteTitle.tid b/editions/tw5tiddlyweb/tiddlers/system/SiteTitle.tid index 5ef449a9a..98cf8e879 100644 --- a/editions/tw5tiddlyweb/tiddlers/system/SiteTitle.tid +++ b/editions/tw5tiddlyweb/tiddlers/system/SiteTitle.tid @@ -1,4 +1,3 @@ title: SiteTitle -type: application/x-tiddler TiddlyWiki5 in the Sky \ No newline at end of file diff --git a/plugins/tiddlywiki/loadrecipe/recipe.js b/plugins/tiddlywiki/loadrecipe/recipe.js index 655bf0ed3..ac7005338 100644 --- a/plugins/tiddlywiki/loadrecipe/recipe.js +++ b/plugins/tiddlywiki/loadrecipe/recipe.js @@ -14,7 +14,7 @@ The idea is to process the recipe file recursively, loading tiddlers into the ma /*global $tw: false */ "use strict"; -exports["application/vnd.tiddlywiki2-recipe"] = function(text,fields) { +exports["text/vnd.tiddlywiki2-recipe"] = function(text,fields) { var self = this, path = require("path"), fs = require("fs"),