From 4ce003cb8220a245a1ec9db92252ccac40bb4a71 Mon Sep 17 00:00:00 2001 From: Alex Kocharin Date: Fri, 16 Jan 2015 13:39:06 +0300 Subject: [PATCH] Remove stateInline.labelUnmatchedScopes looks like a dead code --- lib/helpers/parse_link_label.js | 8 -------- lib/rules_inline/state_inline.js | 5 ----- 2 files changed, 13 deletions(-) diff --git a/lib/helpers/parse_link_label.js b/lib/helpers/parse_link_label.js index 5435cb0..5a450fd 100644 --- a/lib/helpers/parse_link_label.js +++ b/lib/helpers/parse_link_label.js @@ -11,11 +11,6 @@ module.exports = function parseLinkLabel(state, start, disableNested) { max = state.posMax, oldPos = state.pos; - if (state.labelUnmatchedScopes) { - state.labelUnmatchedScopes--; - return -1; - } - state.pos = start + 1; level = 1; @@ -44,9 +39,6 @@ module.exports = function parseLinkLabel(state, start, disableNested) { if (found) { labelEnd = state.pos; - state.labelUnmatchedScopes = 0; - } else { - state.labelUnmatchedScopes = level - 1; } // restore old state diff --git a/lib/rules_inline/state_inline.js b/lib/rules_inline/state_inline.js index ed75e41..000e71d 100644 --- a/lib/rules_inline/state_inline.js +++ b/lib/rules_inline/state_inline.js @@ -17,11 +17,6 @@ function StateInline(src, md, env, outTokens) { this.cache = []; // Stores { start: end } pairs. Useful for backtrack // optimization of pairs parse (emphasis, strikes). - - // Link parser state vars - - this.labelUnmatchedScopes = 0; // Track unpaired `[` for link labels - // (backtrack optimization) }