Ron Au commited on
Commit
75496f8
1 Parent(s): ff8ee9b

feat(trainer name): Allow `@` in input

Browse files
static/js/dom-manipulation.js CHANGED
@@ -44,7 +44,7 @@ const updateCardName = (trainerName, pokeName, useTrainerName) => {
44
  let trainerString = '';
45
 
46
  if (trainerName && useTrainerName) {
47
- trainerName = [...trainerName].filter((char) => char.match(/[\wÀ-ÿ '".,&+#!?:/\\()_-]/g)?.length).join('');
48
  trainerString = `${trainerName}${trainerName.match(/[sSzZ]$/g)?.length ? "' " : "'s "}`;
49
  }
50
 
 
44
  let trainerString = '';
45
 
46
  if (trainerName && useTrainerName) {
47
+ trainerName = [...trainerName].filter((char) => char.match(/[\wÀ-ÿ '".,@&+#!?:/\\()_-]/g)?.length).join('');
48
  trainerString = `${trainerName}${trainerName.match(/[sSzZ]$/g)?.length ? "' " : "'s "}`;
49
  }
50
 
static/js/index.js CHANGED
@@ -68,7 +68,7 @@ const generate = async () => {
68
  };
69
 
70
  nameInput.addEventListener('input', (e) => {
71
- trainerName = [...e.target.value].filter((char) => char.match(/[\wÀ-ÿ '".,&+#!?:/\\()_-]/g)?.length).join('');
72
 
73
  nameInput.value = trainerName;
74
 
 
68
  };
69
 
70
  nameInput.addEventListener('input', (e) => {
71
+ trainerName = [...e.target.value].filter((char) => char.match(/[\wÀ-ÿ '".,@&+#!?:/\\()_-]/g)?.length).join('');
72
 
73
  nameInput.value = trainerName;
74