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:
parent
5276403e39
commit
7a62e6f1a4
@ -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 = {};
|
||||
|
||||
|
@ -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;
|
||||
|
||||
})();
|
||||
|
@ -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;
|
||||
|
||||
})();
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user