From 779d8b3aadde862ac13ca660ed28ba03052d09e7 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Sun, 25 Aug 2013 22:06:28 +0100 Subject: [PATCH] Update TW2 wikitext content type to `text/x-tiddlywiki` And also stop assigning the default content type of `text/vnd.tiddlywiki` to imported tiddlers. --- core/modules/deserializers.js | 4 ++-- core/modules/parsers/textparser.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/modules/deserializers.js b/core/modules/deserializers.js index 979f58c2e..8b9b7dc63 100644 --- a/core/modules/deserializers.js +++ b/core/modules/deserializers.js @@ -86,7 +86,7 @@ exports["application/json"] = function(text,fields) { /* Parse an HTML file into tiddlers. There are three possibilities: -# A TiddlyWiki classic HTML file containing `text/vnd.tiddlywiki2` tiddlers +# A TiddlyWiki classic HTML file containing `text/x-tiddlywiki` tiddlers # A TiddlyWiki5 HTML file containing `text/vnd.tiddlywiki` tiddlers # An ordinary HTML file */ @@ -117,7 +117,7 @@ function deserializeTiddlyWikiFile(text,storeAreaEnd,isTiddlyWiki5,fields) { var results = [], endOfDivRegExp = /(<\/div>\s*)/gi, startPos = storeAreaEnd, - defaultType = isTiddlyWiki5 ? "text/vnd.tiddlywiki": "text/vnd.tiddlywiki2"; + defaultType = isTiddlyWiki5 ? undefined : "text/x-tiddlywiki"; 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 968c87c67..85c5d4426 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["text/vnd.tiddlywiki2"] = TextParser; +exports["text/x-tiddlywiki"] = TextParser; exports["application/javascript"] = TextParser; exports["application/json"] = TextParser; exports["text/css"] = TextParser;