mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 18:17:20 +00:00
Change module type for parsers to "parser"
This commit is contained in:
parent
0e2a0068e5
commit
d28ee0b82a
@ -1,7 +1,7 @@
|
||||
/*\
|
||||
title: $:/core/modules/parsers/imageparser.js
|
||||
type: application/javascript
|
||||
module-type: newparser
|
||||
module-type: parser
|
||||
|
||||
The image parser parses an image into an embeddable HTML element
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*\
|
||||
title: $:/core/modules/parsers/textparser.js
|
||||
type: application/javascript
|
||||
module-type: newparser
|
||||
module-type: parser
|
||||
|
||||
The plain text parser processes blocks of source text into a degenerate parse tree consisting of a single text node
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*\
|
||||
title: $:/core/modules/parsers/wikiparser/wikiparser.js
|
||||
type: application/javascript
|
||||
module-type: newparser
|
||||
module-type: parser
|
||||
|
||||
The wiki text parser processes blocks of source text into a parse tree.
|
||||
|
||||
|
@ -374,12 +374,12 @@ exports.clearCache = function(title) {
|
||||
|
||||
exports.initParsers = function(moduleType) {
|
||||
// Install the new parser modules
|
||||
$tw.wiki.newparsers = {};
|
||||
$tw.wiki.parsers = {};
|
||||
var self = this;
|
||||
$tw.modules.forEachModuleOfType("newparser",function(title,module) {
|
||||
$tw.modules.forEachModuleOfType("parser",function(title,module) {
|
||||
for(var f in module) {
|
||||
if($tw.utils.hop(module,f)) {
|
||||
$tw.wiki.newparsers[f] = module[f]; // Store the parser class
|
||||
$tw.wiki.parsers[f] = module[f]; // Store the parser class
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -396,12 +396,12 @@ Options include:
|
||||
exports.parseText = function(type,text,options) {
|
||||
options = options || {};
|
||||
// Select a parser
|
||||
var Parser = this.newparsers[type];
|
||||
var Parser = this.parsers[type];
|
||||
if(!Parser && $tw.config.fileExtensionInfo[type]) {
|
||||
Parser = this.newparsers[$tw.config.fileExtensionInfo[type].type];
|
||||
Parser = this.parsers[$tw.config.fileExtensionInfo[type].type];
|
||||
}
|
||||
if(!Parser) {
|
||||
Parser = this.newparsers[options.defaultType || "text/vnd.tiddlywiki"];
|
||||
Parser = this.parsers[options.defaultType || "text/vnd.tiddlywiki"];
|
||||
}
|
||||
if(!Parser) {
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user