Skip to content

Fix substitute card badge rendering#45

Open
adrunkhuman wants to merge 1 commit intomasterfrom
fix/substitute-card-badges
Open

Fix substitute card badge rendering#45
adrunkhuman wants to merge 1 commit intomasterfrom
fix/substitute-card-badges

Conversation

@adrunkhuman
Copy link
Copy Markdown
Owner

Summary

  • Walk cell HTML nodes directly instead of using goquery img[src*=...] selectors so card images are attributed to the player anchor that precedes them, not the cell as a whole.
  • Introduce parsedPlayerCell to carry extra timeline events (cards for entrants) back to the caller without polluting PlayerLine.
  • Add replacedYC/replacedByYC fields on lineupEntry and thread them into substitution note rendering so booked substitutes and the players they replaced show the badge inline.
  • Drop the synthetic-entrant-for-badge-visibility path; the card is now visible directly on the exit/entry note of the real lineup row.

Test plan

  • TestParseMatchPageSubstitutionCellAssignsCardsToBothPlayers — parser assigns YC to both starter and entrant in a shared cell.
  • TestAnnotatedLineupKeepsBookedEntrantInReplacementNote — booked entrant no longer needs a synthetic row; badge appears on the starter's exit note.
  • TestFormatLineupPlayerShowsBookedReplacementInsideHomeNote — home exit note renders (72' M. Rzuchowski■).
  • TestFormatLineupPlayerShowsBookedReplacedPlayerInsideAwayNote — away entry note renders (for J. Kowalczyk ■ 46').

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