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

Function isEscaped

internal/attachments/references.go:696–702  ·  view source on GitHub ↗

isEscaped reports whether the byte at i is preceded by an odd number of backslashes, which is what makes it a literal rather than markup.

(src []byte, i int)

Source from the content-addressed store, hash-verified

694// isEscaped reports whether the byte at i is preceded by an odd number of
695// backslashes, which is what makes it a literal rather than markup.
696func isEscaped(src []byte, i int) bool {
697 n := 0
698 for j := i - 1; j >= 0 && src[j] == '\\'; j-- {
699 n++
700 }
701 return n%2 == 1
702}
703
704func skipSpace(src []byte, i, hi int) int {
705 for i < hi && isSpace(src[i]) {

Callers 3

attachAssetsToMarkdownFunction · 0.85
closingBracketFunction · 0.85
linkReferenceDestinationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected