Add quick switch for replacing old wikitext parser with the new

print-window-tiddler
Jeremy Ruston 2012-06-02 13:19:46 +01:00
rodzic 5276403e39
commit 7a62e6f1a4
4 zmienionych plików z 6 dodań i 3 usunięć

Wyświetl plik

@ -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 = {};

Wyświetl plik

@ -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;
})();

Wyświetl plik

@ -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;
})();

Wyświetl plik

@ -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();
}