1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-07-05 19:53:17 +00:00
TiddlyWiki5/core/modules/parsers/wikiparser/rules/wikirule.js

36 lines
731 B
JavaScript
Raw Normal View History

/*\
title: $:/core/modules/parsers/wikiparser/rules/wikirule.js
type: application/javascript
module-type: global
Base class for wiki parser rules
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
var WikiRuleDefaultProperties = {};
/*
To be overridden by individual rules
*/
WikiRuleDefaultProperties.init = function() {
};
/*
Default implementation of findNextMatch looks uses RegExp matching
*/
WikiRuleDefaultProperties.findNextMatch = function(startPos) {
this.matchRegExp.lastIndex = startPos;
this.match = this.matchRegExp.exec(this.parser.source);
return this.match ? this.match.index : undefined;
};
exports.WikiRuleDefaultProperties = WikiRuleDefaultProperties;
})();