Skip to content

Commit 8b2ff6d

Browse files
committed
Fixed "Elephant" IQ Puzzle not being presented anymore
The name of this one does not start with the "IQ PUZZLE • " prefix (most probably a typo), so it was being discarded.
1 parent 152543c commit 8b2ff6d

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

src/recipes/iq_puzzles/IQPuzzlesRecipe.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,22 @@ export class IQPuzzlesRecipe implements Recipe {
4545
return null;
4646
}
4747

48-
const titleMatch = title.match(nameRegex);
49-
const titleGroups = titleMatch?.groups;
48+
let name: string;
5049

51-
const name = titleGroups?.name;
50+
const exceptionTitle = 'Elephant';
51+
if (title === exceptionTitle) {
52+
name = exceptionTitle;
53+
} else {
54+
const titleMatch = title.match(nameRegex);
55+
const titleGroups = titleMatch?.groups;
5256

53-
if (name == null) {
54-
return null;
57+
const tempName = titleGroups?.name;
58+
59+
if (tempName == null) {
60+
return null;
61+
}
62+
63+
name = tempName;
5564
}
5665

5766
const image = product.querySelector('a wow-image img');

0 commit comments

Comments
 (0)