From 493b6bd520c19f19671163d63233a556c3480e7f Mon Sep 17 00:00:00 2001 From: cvillasenor Date: Thu, 11 Jul 2024 16:21:35 -0600 Subject: [PATCH] fix(menu-item): update regex from 'containsHexCode' function to not accept characters that could be present issues --- src/js/utils/str.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/utils/str.js b/src/js/utils/str.js index 145afd374..e516a559d 100644 --- a/src/js/utils/str.js +++ b/src/js/utils/str.js @@ -62,5 +62,5 @@ export const titleCaseEquals = function(str1, str2) { * Whether the string contains a Hex Code */ export const containsHexCode = (string) => { - return /\w*(&#x[0-9a-fA-F]{2,4};)\w*/.test(string); + return /[a-zA-Z\040]*(&#x[0-9a-fA-F]{2,4};)[a-zA-Z\040]*/.test(string); };