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

Function scanAngleDest

internal/attachments/references.go:629–641  ·  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

627// scanAngleDest reads a "<...>" destination beginning at the "<", returning the
628// index just past the closing ">".
629func scanAngleDest(src []byte, i, hi int) (int, bool) {
630 i++
631 for i < hi && src[i] != '>' && src[i] != '\n' {
632 if src[i] == '\\' && i+1 < hi {
633 i++
634 }
635 i++
636 }
637 if i >= hi || src[i] != '>' {
638 return 0, false
639 }
640 return i + 1, true
641}
642
643// linkReferenceDestination finds the destination in a link reference
644// 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