diff --git a/internal/models/annotation.go b/internal/models/annotation.go index 75710cf2b..0a43c097b 100644 --- a/internal/models/annotation.go +++ b/internal/models/annotation.go @@ -81,6 +81,8 @@ var linkSchemes = []string{ } func isLink(s string) bool { + s = strings.TrimSpace(s) + if strings.Contains(s, " ") { return false } diff --git a/internal/models/annotation_test.go b/internal/models/annotation_test.go index b56ebddf2..4d0d6a3e9 100644 --- a/internal/models/annotation_test.go +++ b/internal/models/annotation_test.go @@ -66,7 +66,7 @@ var annotationMapsTestCases = []annotationMapsTestCase{ annotationMap: map[string]string{ "foo": "https://localhost/xxx", "abc": "xyz", - "act": "https://localhost/act", + "act": "https://localhost/act ", }, annotations: models.Annotations{ models.Annotation{ @@ -78,7 +78,7 @@ var annotationMapsTestCases = []annotationMapsTestCase{ }, models.Annotation{ Name: "act", - Value: "https://localhost/act", + Value: "https://localhost/act ", Visible: true, IsLink: true, IsAction: true,