# Attempt to parse a link label returning number of characters parsed
private fun parse_link_label: Int do
var i = index
while i < input.length do
var c = input[i]
if i == index and c != '[' then
return 0
else if c == '[' and i != index then
if input[i - 1] != '\\' or (i - 2 > index and input[i - 2] == '\\') then
return 0
end
else if c == ']' then
if i > 1001 then return 0
if input[i - 1] != '\\' or (i - 2 > index and input[i - 2] == '\\') then
return (i - index) + 1
end
end
i += 1
end
return 0
end
lib/markdown2/markdown_inline_parsing.nit:724,2--744,4