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

Function comparableSource

internal/attachments/references.go:414–416  ·  view source on GitHub ↗

comparableSource reduces a destination read straight from the source to that same form. It still carries the syntax goldmark had already removed: the whitespace separating the destination from the rest of the link, and the angle brackets that let a destination hold a space. Whitespace inside those b

(raw string)

Source from the content-addressed store, hash-verified

412// angle brackets that let a destination hold a space. Whitespace inside those
413// brackets is part of the name, so only the whitespace outside them goes.
414func comparableSource(raw string) string {
415 return comparableDestination(trimAngles(strings.TrimSpace(raw)))
416}
417
418func trimAngles(s string) string {
419 if len(s) >= 2 && s[0] == '<' && s[len(s)-1] == '>' {

Callers 1

linkReferenceDestinationFunction · 0.85

Calls 2

comparableDestinationFunction · 0.85
trimAnglesFunction · 0.85

Tested by

no test coverage detected