Skip to content

check_cards: an extra card figure is accepted, and a card with an unreadable figure is reported as missing #218

Description

@realmarcin

From the round-1 review of #212 (#114).

Where: scripts/fleet/card_markup.py:29, scripts/fleet/assemble_page.py:119, scripts/fleet/check_cards.py:199-200.

Extra figures pass. card_figures() keeps only the first <div class="num"><b>N</b> inside each <article> and ignores any others, and any figure outside every card. At 8e49cd0, all three of these failed with "Every Mech card must carry a record count". On the branch they all pass:

  • a second stat tile above HabitatMech's headline, which renders the records tile as 1,072,961 instead of 1,075,481;
  • a second tile after the headline;
  • a stray figure outside the cards.

Unreadable figures get the wrong message. A card whose figure doesn't parse (for example <b>625,960 </b>) drops out of card_figures(). check_cards.py then reports "UNCARDED TaxonMech: SOURCES entry with no card in the template" and advises adding a missing card. The card exists; only its figure markup is wrong.

Fix: have card_markup report every figure per card and any figure outside a card. assemble_page then requires exactly one figure per card, and check_cards reports a card with no figure or with several as a markup failure, not as UNCARDED.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions