raw and comment

This commit is contained in:
harttle
2016-06-20 01:10:43 +08:00
parent 54bc206d36
commit 8053d7021f
16 changed files with 105 additions and 51 deletions
+1 -12
View File
@@ -24,6 +24,7 @@ module.exports = function(Tag, Filter) {
start: function() {
this.trigger('start');
while (!this.stopRequested && (token = this.tokens.shift())) {
if (this.trigger('token', token)) continue;
if (token.type == 'tag' &&
this.trigger(`tag:${token.name}`, token)) {
continue;
@@ -37,18 +38,6 @@ module.exports = function(Tag, Filter) {
stop: function() {
this.stopRequested = true;
return this;
},
onStart: function(cb) {
return this.on('start', cb);
},
onEnd: function(cb) {
return this.on('end', cb);
},
onTag: function(name, cb) {
return this.on(`tag:${name}`, cb);
},
onTemplate: function(cb) {
return this.on('template', cb);
}
};