8000 fix(parser): drop empty cells from opening/ending theme lists (jikan#593) by irfan-dahir · Pull Request #614 · jikan-me/jikan · GitHub
[go: up one dir, main page]

Skip to content

fix(parser): drop empty cells from opening/ending theme lists (jikan#593) - #614

Merged
irfan-dahir merged 1 commit into
5.0.0from
fix/theme-empties
Oct 11, 2026
Merged

irfan-dahir merged 1 commit into
5.0.0from
fix/theme-empties

Conversation

@irfan-dahir
Copy link
Copy Markdown
Collaborator

Fixes jikan#593 (reproduced live on current 5.0.0).

Root cause

Current MAL anime pages render the theme-songs table with empty <td> cells interleaved with the real theme rows. getOpeningThemes() (tr/td) and getEndingThemes() (tr) collected every cell, so a one-theme title returned ['', theme, ''] — reproduced live on anime 59193: 9 items, 6 empty.

Fix

Filter the cleansed cells ('') and re-index. Live-verified: 59193 → 3 real openings / 2 endings; anime 1 (Cowboy Bebop) unchanged at 3+3.

Test story

The anime-6 fixture already records the current markup (three <td>, only the middle real) — so it_gets_the_anime_opening was asserting the bug (assertCount(3)). Updated to the fixed behaviour (assertCount(1)) and added assertNotContains('') regression guards for both theme directions.

composer test 394/394, php-cs-fixer clean.

…593)

Current MAL anime pages render the theme-songs table with empty <td> cells
interleaved with the real theme rows. getOpeningThemes() (tr/td) and
getEndingThemes() (tr) collected every cell, so a one-theme title returned
['', theme, ''] — exactly the open issue jikan#593 (regression surfaced in
5.0.0-alpha.3).

Filter the clean
9AC9
sed cells ('') and re-index, so theme lists contain only the
real theme strings. Live-verified on anime 59193: 9 items (6 empty) -> 3 real
openings; 2 endings unchanged.

The anime-6 fixture already records the current markup (three <td>, middle
one real), so the test 'it_gets_the_anime_opening' previously asserted the
bug (count 3). Updated to the fixed behaviour (count 1) and added
assertNotContains('') regression guard for #593 on both theme directions.
composer test 394/394, php-cs-fixer clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0