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

Function singleLineFieldValue

pkg/cmd/project/shared/queries/queries.go:504–506  ·  view source on GitHub ↗

singleLineFieldValue collapses carriage returns and newlines so a multi-line field value stays within a single table cell. Following the convention used by StatusItem.Preview, carriage returns are dropped and newlines become spaces.

(s string)

Source from the content-addressed store, hash-verified

502// field value stays within a single table cell. Following the convention used by
503// StatusItem.Preview, carriage returns are dropped and newlines become spaces.
504func singleLineFieldValue(s string) string {
505 return strings.ReplaceAll(strings.ReplaceAll(s, "\r", ""), "\n", " ")
506}
507
508type DraftIssue struct {
509 ID string

Callers 2

DisplayValueMethod · 0.85
TestSingleLineFieldValueFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestSingleLineFieldValueFunction · 0.68