MCPcopy Index your code
hub / github.com/git-bug/git-bug / CleanupOneLine

Function CleanupOneLine

util/text/transform.go:35–48  ·  view source on GitHub ↗
(text string)

Source from the content-addressed store, hash-verified

33}
34
35func CleanupOneLine(text string) string {
36 // remove all unicode control characters *including*
37 // '\n', '\r' and '\t'
38 t := runes.Remove(runes.Predicate(unicode.IsControl))
39 sanitized, _, err := transform.String(t, text)
40 if err != nil {
41 // transform.String should never return an error as our transformer doesn't returns one.
42 // Confirmed with fuzzing.
43 panic(err)
44 }
45
46 // trim extra new line not displayed in the github UI but still present in the data
47 return strings.TrimSpace(sanitized)
48}
49
50func CleanupOneLineArray(texts []string) []string {
51 for i := range texts {

Callers 15

ensureIssueMethod · 0.92
ensureTimelineItemMethod · 0.92
ImportAllMethod · 0.92
TitleMethod · 0.92
ensureIssueMethod · 0.92
LabelEventsFunction · 0.92
ensureIssueMethod · 0.92
ensureChangeMethod · 0.92
runBugNewFunction · 0.92
runBugTitleEditFunction · 0.92
BugCreateMethod · 0.92
BugSetTitleMethod · 0.92

Calls 2

RemoveMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected