From 71008d5a2068a978b11884c9ec5c984c6e4b03b3 Mon Sep 17 00:00:00 2001 From: Andrew Ekstedt Date: Thu, 10 Sep 2020 14:46:07 -0700 Subject: [PATCH] Avoid lookbehind assertion The game fails to load under Firefox 77.0 with the very helpful error message, SyntaxError: invalid regexp group format-c2m.js:1:1 Turns out that it doesn't like the `(?<=^|\n)` lookbehind group in the CLUE regexp. It seems lookbehind support wasn't added until FF 78, according to the big table[1]. Switch it to a multiline regexp instead. [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Browser_compatibility --- js/format-c2m.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/format-c2m.js b/js/format-c2m.js index 5791e9b..5311925 100644 --- a/js/format-c2m.js +++ b/js/format-c2m.js @@ -290,7 +290,7 @@ export function parse_level(buf) { // for levels with multiple hint tiles, delineated by [CLUE]. // For my purposes, extra hints are associated with the // individual tiles, so we'll map those later - [level.comment, ...extra_hints] = str.split(/(?<=^|\n)\[CLUE\]\n/g); + [level.comment, ...extra_hints] = str.split(/^\[CLUE\]$/mg); } continue; }