Skip to content

card_markup: '<b>,</b>' crashes the check, and a figure with a stray space escapes the one-figure rule #261

Description

@realmarcin

From the Codex review of #212 (follows #218).

Where: scripts/fleet/card_markup.py.

  • A crash: FIGURE accepts [\d,]+, so <div class="num"><b>,</b> parses and then int("") raises ValueError. Through main(), no rows print at all.
  • An escape: a second tile such as <div class="num"><b>7 </b></div> doesn't match FIGURE, because of the trailing space. markup_problems() doesn't count it, the check passes, and assemble() renders both tiles.

Fix: count the headline tiles themselves (<div class="num">), requiring exactly one per card and none outside the cards. Read the figure only from a tile that starts with a digit, and report anything else as MARKUP.

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