Browse Source

Remove stateCore.push() method

pull/82/head
Alex Kocharin 10 years ago
parent
commit
e173111e40
  1. 3
      lib/rules_core/block.js
  2. 13
      lib/rules_core/state_core.js

3
lib/rules_core/block.js

@ -5,10 +5,11 @@ module.exports = function block(state) {
var token; var token;
if (state.inlineMode) { if (state.inlineMode) {
token = state.push('inline', '', 0); token = new state.Token('inline', '', 0);
token.content = state.src; token.content = state.src;
token.map = [ 0, 1 ]; token.map = [ 0, 1 ];
token.children = []; token.children = [];
state.tokens.push(token);
} else { } else {
state.md.block.parse(state.src, state.md, state.env, state.tokens); state.md.block.parse(state.src, state.md, state.env, state.tokens);
} }

13
lib/rules_core/state_core.js

@ -13,19 +13,6 @@ function StateCore(src, md, env) {
this.md = md; // link to parser instance this.md = md; // link to parser instance
} }
// Push new token to "stream".
//
StateCore.prototype.push = function (type, tag, nesting) {
var token = new Token(type, tag, nesting);
if (nesting < 0) { this.level--; }
token.level = this.level;
if (nesting > 0) { this.level++; }
this.tokens.push(token);
return token;
};
// re-export Token class to use in core rules // re-export Token class to use in core rules
StateCore.prototype.Token = Token; StateCore.prototype.Token = Token;

Loading…
Cancel
Save