MCPcopy
hub / github.com/1Password/for-open-source / ParseInput

Function ParseInput

script/validator.go:67–81  ·  view source on GitHub ↗
(value string)

Source from the content-addressed store, hash-verified

65}
66
67func ParseInput(value string) (bool, string, string) {
68 if value == "" || value == "_No response_" || value == "None" {
69 return true, "", ""
70 }
71
72 // strip all formatting, except for newlines
73 html := blackfriday.Run([]byte(value))
74 doc, err := goquery.NewDocumentFromReader(bytes.NewReader(html))
75 if err != nil {
76 return false, value, err.Error()
77 }
78 value = strings.TrimSpace(doc.Text())
79
80 return true, value, ""
81}
82
83func ParsePlainString(value string) (bool, string, string) {
84 if urlRegex.MatchString(value) {

Callers 1

stringSectionMethod · 0.85

Calls 1

ErrorMethod · 0.80

Tested by

no test coverage detected