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

Function isEscaped

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

731// isEscaped reports whether the byte at i is preceded by an odd number of
732// backslashes, which is what makes it a literal rather than markup.
733func isEscaped(src []byte, i int) bool {
734 n := 0
735 for j := i - 1; j >= 0 && src[j] == '\\'; j-- {
736 n++
737 }
738 return n%2 == 1
739}
740
741func skipSpace(src []byte, i, hi int) int {
742 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