in src/commonMain/kotlin/org/intellij/markdown/parser/sequentialparsers/impl/LinkParserUtil.kt [55:86]
fun parseLinkLabel(iterator: TokensCache.Iterator): LocalParsingResult? {
var it = iterator
if (it.type != MarkdownTokenTypes.LBRACKET) {
return null
}
val startIndex = it.index
val delegate = RangesListBuilder()
it = it.advance()
while (it.type != MarkdownTokenTypes.RBRACKET && it.type != null) {
delegate.put(it.index)
if (it.type == MarkdownTokenTypes.LBRACKET) {
break
}
it = it.advance()
}
if (it.type == MarkdownTokenTypes.RBRACKET) {
val endIndex = it.index
if (endIndex == startIndex + 1) {
return null
}
return LocalParsingResult(it,
listOf(SequentialParser.Node(startIndex..endIndex + 1, MarkdownElementTypes.LINK_LABEL)),
delegate.get())
}
return null
}