fix: strip punctuation in normalizeTitle so comma variants match (e.g. 'Mr. Lawrence' vs 'Mr, Lawrence')

This commit is contained in:
Honey committed 2026-05-27 17:49:31 +02:00
1 parent 9821334cc8
commit 09cec18b33
1 file changed
+3
+3
View File
@@ -82,6 +82,9 @@ function normalizeTitle(s) {
.replace(/\s+-\s+([^-]+)$/, ' ($1)')
// strip all remaining parens/brackets content for the base comparison
.replace(/[\[((][^\]))]*[\]))]/g, '')
// strip punctuation so "Mr. Lawrence" == "Mr Lawrence" and comma variants match
.replace(/[,.'!?]/g, '')
.replace(/\s+/g, ' ')
.trim();
}