|
@ -17,6 +17,11 @@ function parseLinkLabel(state, start) { |
|
|
|
|
|
|
|
|
if (state.validateInsideLink) { return -1; } |
|
|
if (state.validateInsideLink) { return -1; } |
|
|
|
|
|
|
|
|
|
|
|
if (state.label_nest_level) { |
|
|
|
|
|
state.label_nest_level--; |
|
|
|
|
|
return -1; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
state.pos = start + 1; |
|
|
state.pos = start + 1; |
|
|
state.validateInsideLink = true; |
|
|
state.validateInsideLink = true; |
|
|
level = 1; |
|
|
level = 1; |
|
@ -38,7 +43,12 @@ function parseLinkLabel(state, start) { |
|
|
if (!ok) { state.pending += state.src[state.pos++]; } |
|
|
if (!ok) { state.pending += state.src[state.pos++]; } |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (found) { labelEnd = state.pos; } |
|
|
if (found) { |
|
|
|
|
|
labelEnd = state.pos; |
|
|
|
|
|
state.label_nest_level = 0; |
|
|
|
|
|
} else { |
|
|
|
|
|
state.label_nest_level = level - 1; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// restore old state
|
|
|
// restore old state
|
|
|
state.pos = oldPos; |
|
|
state.pos = oldPos; |
|
|