1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-10-01 00:10:45 +00:00
This commit is contained in:
Jeremy Ruston 2012-01-27 16:35:55 +00:00
parent 3e62698efb
commit f29f06f3e9

View File

@ -26,13 +26,9 @@ var App = function() {
this.isBrowser = typeof window !== "undefined";
// Create the main store
this.store = new WikiStore();
// Register the wikitext parser and the image parser
this.store.registerParser("text/x-tiddlywiki",new WikiTextParser({
store: this.store
}));
this.store.registerParser("application/json",new JSONParser({
store: this.store
}));
// Register the parsers
this.store.registerParser("text/x-tiddlywiki",new WikiTextParser({store: this.store}));
this.store.registerParser("application/json",new JSONParser({store: this.store}));
var imageParser = new ImageParser();
this.store.registerParser("image/svg+xml",imageParser);
this.store.registerParser("image/jpg",imageParser);
@ -84,7 +80,7 @@ var App = function() {
this.store.addTiddler(new Tiddler(tiddlers[t]));
}
}
// Set up the JavaScript parser
// Set up the JavaScript parser. Currently a hack; the idea is that the parsers would be loaded through a boot recipe
if(this.isBrowser) {
this.store.jsParser = new JavaScriptParser(this.store.getTiddlerText("javascript.pegjs"));
} else {