Browse Source

Simplified StateInline

pull/14/head
Vitaly Puzrin 10 years ago
parent
commit
6a05b0674c
  1. 2
      lib/parser_ref.js
  2. 6
      lib/rules_inline/state_inline.js

2
lib/parser_ref.js

@ -57,7 +57,7 @@ module.exports = function parse_reference(str, parser, options, env) {
}
// ensure that the end of the line is empty
pos = state.skipSpaces(pos);
while (pos < max && state.src.charCodeAt(pos) === 0x20/* space */) { pos++; }
if (pos < max && state.src.charCodeAt(pos) !== 0x0A) { return -1; }
label = normalizeReference(str.slice(1, labelEnd));

6
lib/rules_inline/state_inline.js

@ -42,11 +42,5 @@ StateInline.prototype.push = function (token) {
this.pendingLevel = this.level;
};
StateInline.prototype.skipSpaces = function skipSpaces(pos) {
for (var max = this.src.length; pos < max; pos++) {
if (this.src.charCodeAt(pos) !== 0x20/* space */) { break; }
}
return pos;
};
module.exports = StateInline;

Loading…
Cancel
Save