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

Function inlineDestination

internal/attachments/references.go:564–572  ·  view source on GitHub ↗

inlineDestination finds the destination written beside a reference, as the "./f.png" of [text](./f.png).

(src []byte, i, hi int)

Source from the content-addressed store, hash-verified

562// inlineDestination finds the destination written beside a reference, as the
563// "./f.png" of [text](./f.png).
564func inlineDestination(src []byte, i, hi int) byteRange {
565 i = skipSpace(src, i, hi)
566 if i < hi && src[i] == '<' {
567 if stop, ok := scanAngleDest(src, i, hi); ok {
568 return byteRange{i, stop}
569 }
570 }
571 return byteRange{i, scanBareDest(src, i, hi)}
572}
573
574// scanBareDest reads an unbracketed destination, which ends at whitespace or
575// at the ")" closing the link. Parentheses inside the path are part of it as

Callers 1

inlineRangesFunction · 0.85

Calls 3

skipSpaceFunction · 0.85
scanAngleDestFunction · 0.85
scanBareDestFunction · 0.85

Tested by

no test coverage detected