From d57cc7d67eb5abc15dc2d968302809b527925e50 Mon Sep 17 00:00:00 2001 From: moonqqqq Date: Sun, 3 Sep 2017 20:37:35 -0400 Subject: [PATCH] update regex to avoid incorrect match with the original regex, it will match some incorrect classes. For example, if the itemP is ".abc", then ".abc2" will also be considered as a match. This bug will cause the incorrect CSS text in demo. For example, if you click on Slide Middle, it will show CSS text for class ".hb-fill-middle2:hover" --- demo/js/functions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo/js/functions.js b/demo/js/functions.js index 7a5c35f..9fa7d53 100644 --- a/demo/js/functions.js +++ b/demo/js/functions.js @@ -242,7 +242,7 @@ function getSelectorCss(selector, stylesheet) { if (mySelector.match(/,/)) { //if mySelector has commas: mySelectorArray = mySelector.split(','); //split into array where commas separate items mySelectorArray.forEach(function(itemP, indexP) { //cycle through the array - regexSelector = new RegExp(selector + '.*'); + regexSelector = new RegExp(selector + '(?:$|[^0-9]+)'); finalSelector = itemP.match(regexSelector); if (finalSelector !== null) { selectorLoopResult = finalSelector[0];