@@ -31,10 +31,9 @@ import (
3131)
3232
3333const (
34- missingAreaLabelPrefix = "MISSING_AREA"
35- areaLabelPrefix = "area/"
36- multipleAreaLabelsPrefix = "MULTIPLE_AREAS["
37- documentationArea = "Documentation"
34+ missingAreaLabelPrefix = "MISSING_AREA"
35+ areaLabelPrefix = "area/"
36+ documentationArea = "Documentation"
3837)
3938
4039var (
@@ -192,7 +191,7 @@ func (g prEntriesProcessor) generateNoteEntry(p *pr) *notesEntry {
192191 }
193192
194193 if g .addAreaPrefix {
195- entry .title = trimAreaFromTitle (entry .title , area )
194+ entry .title = trimAreaFromTitle (entry .title )
196195 entry .title = capitalize (entry .title )
197196 entry .title = fmt .Sprintf ("- %s: %s" , area , entry .title )
198197 } else {
@@ -227,7 +226,7 @@ func (g prEntriesProcessor) extractArea(pr *pr) string {
227226 case 1 :
228227 return areaLabels [0 ]
229228 default :
230- return multipleAreaLabelsPrefix + strings .Join (areaLabels , "/" ) + "]"
229+ return strings .Join (areaLabels , "/" )
231230 }
232231}
233232
@@ -281,11 +280,10 @@ func removePrefixes(title string, prefixes []string) string {
281280}
282281
283282// trimAreaFromTitle removes the prefixed area from title to avoid duplication.
284- func trimAreaFromTitle (title , area string ) string {
285- titleWithoutArea := title
286- pattern := `(?i)^` + regexp .QuoteMeta (area + ":" )
287- re := regexp .MustCompile (pattern )
288- titleWithoutArea = re .ReplaceAllString (titleWithoutArea , "" )
283+ func trimAreaFromTitle (title string ) string {
284+ re := regexp .MustCompile (`^[^:]*:\s*` )
285+ titleWithoutArea := re .ReplaceAllString (title , "" )
289286 titleWithoutArea = strings .TrimSpace (titleWithoutArea )
287+
290288 return titleWithoutArea
291289}
0 commit comments