Skip to content

Commit 888aca4

Browse files
edited regex pattern
1 parent bf7a925 commit 888aca4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/generator/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,14 +224,14 @@ func gatewayTweaks(channel string, props map[string]apiext.JSONSchemaProps) map[
224224

225225
startTag = "<gateway:util:excludeFromCRD>"
226226
endTag = "</gateway:util:excludeFromCRD>"
227-
regexPattern = `(?:\r?\n)*` + regexp.QuoteMeta(startTag) + `(?s:(.*?))` + regexp.QuoteMeta(endTag) + `(?:\r?\n)*`
227+
regexPattern = `\n*` + regexp.QuoteMeta(startTag) + `(?s:(.*?))` + regexp.QuoteMeta(endTag) + `\n*`
228228
if strings.Contains(jsonProps.Description, "<gateway:util:excludeFromCRD>") {
229229
re := regexp.MustCompile(regexPattern)
230230
match := re.FindStringSubmatch(jsonProps.Description)
231231
if len(match) != 2 {
232232
log.Fatalf("Invalid <gateway:util:excludeFromCRD> tag for %s", name)
233233
}
234-
modifiedDescription := re.ReplaceAllString(jsonProps.Description, "\n\n")
234+
modifiedDescription := re.ReplaceAllString(jsonProps.Description, "\n\n\n")
235235
jsonProps.Description = modifiedDescription
236236
}
237237

0 commit comments

Comments
 (0)