MCPcopy Create free account
hub / github.com/cli/cli / scanAngleDest

Function scanAngleDest

internal/attachments/references.go:666–678  ·  view source on GitHub ↗

scanAngleDest reads a "<...>" destination beginning at the "<", returning the index just past the closing ">".

(src []byte, i, hi int)

Source from the content-addressed store, hash-verified

664// scanAngleDest reads a "<...>" destination beginning at the "<", returning the
665// index just past the closing ">".
666func scanAngleDest(src []byte, i, hi int) (int, bool) {
667 i++
668 for i < hi && src[i] != '>' && src[i] != '\n' {
669 if src[i] == '\\' && i+1 < hi {
670 i++
671 }
672 i++
673 }
674 if i >= hi || src[i] != '>' {
675 return 0, false
676 }
677 return i + 1, true
678}
679
680// linkReferenceDestination finds the destination in a link reference
681// definition, as the "./f.png" of [ref]: ./f.png "a title", so that rewriting

Callers 2

inlineDestinationFunction · 0.85
linkReferenceDestinationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected