1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 12:07:19 +00:00

Add quick switch for replacing old wikitext parser with the new

This commit is contained in:
Jeremy Ruston 2012-06-02 13:19:46 +01:00
parent 5276403e39
commit 7a62e6f1a4
4 changed files with 6 additions and 3 deletions

View File

@ -35,6 +35,9 @@ if(typeof(window) === "undefined" && !global.$tw) {
global.$tw = {}; // No ``browser`` member for the server
}
// Temporary switch for replacing the old wiki text parser with the new one
$tw.useNewParser = false;
// Boot information
$tw.boot = {};

View File

@ -180,6 +180,6 @@ WikiTextParser.prototype.parse = function(type,text) {
});
};
exports["text/x-tiddlywiki-new"] = WikiTextParser;
exports[$tw.useNewParser ? "text/x-tiddlywiki" : "text/x-tiddlywiki-new"] = WikiTextParser;
})();

View File

@ -182,6 +182,6 @@ WikiTextParser.prototype.subWikifyTerm = function(output,terminatorRegExp) {
this.output = oldOutput;
};
exports["text/x-tiddlywiki"] = WikiTextParser;
exports[$tw.useNewParser ? "text/x-tiddlywiki-old" : "text/x-tiddlywiki"] = WikiTextParser;
})();

View File

@ -253,7 +253,7 @@ exports.initParsers = function(moduleType) {
}
}
// Install the rules for the old wikitext parser rules
var wikitextparser = this.parsers["text/x-tiddlywiki"];
var wikitextparser = this.parsers[$tw.useNewParser ? "text/x-tiddlywiki-old" : "text/x-tiddlywiki"];
if(modules && wikitextparser) {
wikitextparser.installRules();
}