From b4ea423221a15e3163192ca063a3163c02de4cd1 Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Sat, 10 Feb 2018 11:37:00 -0500 Subject: [PATCH] Encoding parenthesis in generated URLs Closes #36 --- src/js/regexper.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/regexper.js b/src/js/regexper.js index 74e22a9..7444cf4 100644 --- a/src/js/regexper.js +++ b/src/js/regexper.js @@ -99,7 +99,9 @@ export default class Regexper { // Set the URL hash. This method exists to facilitate automated testing // (since changing the URL can throw off most JavaScript testing tools). _setHash(hash) { - location.hash = encodeURIComponent(hash); + location.hash = encodeURIComponent(hash) + .replace(/\(/g, '%28') + .replace(/\)/g, '%29'); } // Retrieve the current URL hash. This method is also mostly for supporting