From 8b8b17a48682b19d0ee4f6600eff2f1cd8527d0a Mon Sep 17 00:00:00 2001 From: nuxen <47067662+nuxencs@users.noreply.github.com> Date: Sat, 30 Dec 2023 13:13:22 +0100 Subject: [PATCH] fix(processor): `What If` not getting processed correctly (#73) --- internal/processor/title.go | 2 +- internal/processor/title_test.go | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/processor/title.go b/internal/processor/title.go index f98d8f4..da2d438 100644 --- a/internal/processor/title.go +++ b/internal/processor/title.go @@ -19,7 +19,7 @@ func processTitle(title string, matchRelease bool) []string { t := NewTitleSlice() // Regex patterns - replaceRegexp := regexp.MustCompile(`[[:punct:]\s\x{00a0}\x{2000}-\x{200f}\x{2028}-\x{202f}\x{205f}-\x{206f}à-üÀ-Ü]`) + replaceRegexp := regexp.MustCompile(`[[:punct:]\s\x{00a0}\x{2000}-\x{200f}\x{2026}-\x{202f}\x{205f}-\x{206f}à-üÀ-Ü]`) questionmarkRegexp := regexp.MustCompile(`[?]{2,}`) regionCodeRegexp := regexp.MustCompile(`\(.+\)$`) parenthesesEndRegexp := regexp.MustCompile(`\)$`) diff --git a/internal/processor/title_test.go b/internal/processor/title_test.go index 951c7ea..eb5389c 100644 --- a/internal/processor/title_test.go +++ b/internal/processor/title_test.go @@ -200,6 +200,14 @@ func Test_processTitle(t *testing.T) { }, want: []string{"Whose?Line?Is?It?Anyway", "Whose?Line?Is?It?Anyway?", "Whose?Line?Is?It?Anyway*US*1932", "Whose?Line?Is?It?Anyway*US*1932?"}, }, + { + name: "test_24", + args: args{ + title: "What If…?", + matchRelease: false, + }, + want: []string{"What?If", "What?If*"}, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {