MCPcopy Create free account
hub / github.com/crashappsec/github-analyzer / normalizeLinks

Function normalizeLinks

pkg/output/html/html.go:48–59  ·  view source on GitHub ↗

normalizeLinks converts any raw http links to hrefs

(input string)

Source from the content-addressed store, hash-verified

46
47// normalizeLinks converts any raw http links to hrefs
48func normalizeLinks(input string) string {
49 sep := strings.Split(input, " ")
50 for i, s := range sep {
51 if strings.HasPrefix(s, "https://") || strings.HasPrefix(s, "http://") {
52 sep[i] = fmt.Sprintf(
53 "<a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>",
54 s,
55 )
56 }
57 }
58 return strings.Join(sep, " ")
59}
60
61func getSeverity(sev string) string {
62 switch sev {

Callers 1

parseIssuesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected