Skip to content

Commit

Permalink
fix: support hyphens in card number
Browse files Browse the repository at this point in the history
  • Loading branch information
BrettOrmsby committed Feb 4, 2024
1 parent 318109c commit 09d561e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/EnterDeck.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
</template>

<script lang="ts" setup>
// TODO: it does not work when hiding global tags but tagging with deck specific tags that are the same name as the hidden global tag (ie #!interaction will not work to apply the new tag #interaction)
// TODO: Star of Extinction (MB1) 1068 does not work
import Textarea from "primevue/textarea";
import Button from "primevue/button";
import CheckIcon from "@/components/icons/CheckIcon.vue";
Expand Down Expand Up @@ -220,7 +222,7 @@ const deckToJson = (deck: string): { cards: DeckCard[]; errors: number[] } => {
// Try to match the card
const matches = line
.trim()
.match(/^(\d+) (.+?) \(([A-Za-z0-9]+)\) ([A-Za-z0-9]+)( \*F\*)?( (#!?.+? ?)*)?$/);
.match(/^(\d+) (.+?) \(([A-Za-z0-9]+)\) ([-A-Za-z0-9]+)( \*F\*)?( (#!?.+? ?)*)?$/);
if (matches === null) {
errors.push(i);
continue;
Expand Down

0 comments on commit 09d561e

Please sign in to comment.