fix: match Wikipedia's hyphen-free heading style for QF and SF rounds

Wikipedia 2026 uses "Quarterfinals" and "Semifinals" (no hyphen/space).
The old regexes /quarter.final/ and /semi.final/ require a separator char
between "quarter"/"semi" and "final", so the dot consumed the 'f' and the
remaining "inals" failed to match "final". Changed to /quarter.?finals?/
and /semi.?finals?/ to handle both hyphenated and non-hyphenated forms.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-07-05 09:35:16 +02:00
co-authored by Claude Sonnet 4.6
parent a437affd1d
commit e3dd53c40c
+4 -4
View File
@@ -258,9 +258,9 @@ function processHeading(text: string, level: number, state: State): void {
state.active = true; state.round = ''; state.group = null
} else if (/round of 16/i.test(t)) {
state.active = true; state.round = 'Round of 16'; state.group = null
} else if (/quarter.final/i.test(t)) {
} else if (/quarter.?finals?/i.test(t)) {
state.active = true; state.round = 'Quarter-finals'; state.group = null
} else if (/semi.final/i.test(t)) {
} else if (/semi.?finals?/i.test(t)) {
state.active = true; state.round = 'Semi-finals'; state.group = null
} else if (/third.place|match for third|play.off for third/i.test(t)) {
state.active = true; state.round = 'Third-place match'; state.group = null
@@ -279,9 +279,9 @@ function processHeading(text: string, level: number, state: State): void {
state.round = 'Round of 32'; state.group = null
} else if (/round of 16/i.test(t)) {
state.round = 'Round of 16'; state.group = null
} else if (/quarter.final/i.test(t)) {
} else if (/quarter.?finals?/i.test(t)) {
state.round = 'Quarter-finals'; state.group = null
} else if (/semi.final/i.test(t)) {
} else if (/semi.?finals?/i.test(t)) {
state.round = 'Semi-finals'; state.group = null
} else if (/third.place|match for third|play.off for third/i.test(t)) {
state.round = 'Third-place match'; state.group = null