From ed714df4cd8b8d46ab68272c43b1df270d66a04f Mon Sep 17 00:00:00 2001 From: synth_ruiner Date: Sun, 31 Mar 2019 14:23:58 +0100 Subject: [PATCH] fix palette matching regex --- includes/script.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/script.js b/includes/script.js index 07ca460..ea92690 100644 --- a/includes/script.js +++ b/includes/script.js @@ -109,7 +109,7 @@ $(document).ready(function() { bitsyData = {}; // get palettes - var palettes = input.match(/PAL (.*)\s(NAME (.*)\s)?([0-9,]*[\s]){3}/g); + var palettes = input.match(/PAL ([^\n]*)\n(NAME ([^\n]*)\n)?(([0-9,]+){3}\n){3,}/g); bitsyData.palettes = {}; @@ -544,6 +544,8 @@ $(document).ready(function() { // write $textArea.val(newGameData); + handleBitsyGameData(); + // todo: give the user some nice "yay! it worked!" kinda feedback? }); });