Repository navigation
fix(parser): drop empty cells from opening/ending theme lists (jikan#593) - #614
Merged
Merged
Conversation
…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.
This was referenced Oct 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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) andgetEndingThemes()(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) — soit_gets_the_anime_openingwas asserting the bug (assertCount(3)). Updated to the fixed behaviour (assertCount(1)) and addedassertNotContains('')regression guards for both theme directions.composer test394/394, php-cs-fixer clean.