diff --git a/lib/parser_ref.js b/lib/parser_ref.js index 7aa9039..f010c0c 100644 --- a/lib/parser_ref.js +++ b/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)); diff --git a/lib/rules_inline/state_inline.js b/lib/rules_inline/state_inline.js index 40be36a..b361664 100644 --- a/lib/rules_inline/state_inline.js +++ b/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;