Skip to content

Commit

Permalink
packgen - allow spaces in author/pack name
Browse files Browse the repository at this point in the history
also convert spaces to underscores or dashes
  • Loading branch information
BeatACVR authored Dec 30, 2024
1 parent bc8beb8 commit 23e43cd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packgen.html
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,9 @@ <h2>Release Sounds (max 25)</h2>
document.querySelectorAll('input[type="text"]').forEach(input => {
input.addEventListener('input', (e) => {
const value = e.target.value;
if (!/^[a-zA-Z0-9-_]*$/.test(value)) {
alert('Only alphanumeric characters, dashes (-), and underscores (_) are allowed.');
e.target.value = value.replace(/[^a-zA-Z0-9-_]/g, '');
if (!/^[a-zA-Z0-9-_ ]*$/.test(value)) {
alert('Only alphanumeric characters, spaces, dashes (-), and underscores (_) are allowed.');
e.target.value = value.replace(/[^a-zA-Z0-9-_ ]/g, '');
}
});
});
Expand Down

0 comments on commit 23e43cd

Please sign in to comment.