mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 18:17:20 +00:00
Refactored formatters out of global config object
This commit is contained in:
parent
e1f26eb07b
commit
f33880f506
@ -7,14 +7,12 @@ var Tiddler = require("./Tiddler.js").Tiddler,
|
||||
util = require("util");
|
||||
|
||||
|
||||
function Formatter(formatters)
|
||||
function Formatter()
|
||||
{
|
||||
var n;
|
||||
this.formatters = [];
|
||||
var pattern = [];
|
||||
for(n=0; n<formatters.length; n++) {
|
||||
pattern.push("(" + formatters[n].match + ")");
|
||||
this.formatters.push(formatters[n]);
|
||||
this.formatters = Formatter.formatters;
|
||||
for(var n=0; n<this.formatters.length; n++) {
|
||||
pattern.push("(" + this.formatters[n].match + ")");
|
||||
}
|
||||
this.formatterRegExp = new RegExp(pattern.join("|"),"mg");
|
||||
}
|
||||
@ -88,7 +86,7 @@ Formatter.isExternalLink = function(link) {
|
||||
return false;
|
||||
};
|
||||
|
||||
config.formatters = [
|
||||
Formatter.formatters = [
|
||||
{
|
||||
name: "table",
|
||||
match: "^\\|(?:[^\\n]*)\\|(?:[fhck]?)$",
|
||||
|
Loading…
Reference in New Issue
Block a user