From 026dc1bf00e150850e401328fb4e1a38b01cd321 Mon Sep 17 00:00:00 2001 From: qmegas Date: Mon, 31 Jul 2023 15:07:44 +0200 Subject: [PATCH] Bug fix #82 --- src/optimize.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/optimize.js b/src/optimize.js index 2d89309..2c9acfb 100644 --- a/src/optimize.js +++ b/src/optimize.js @@ -129,7 +129,7 @@ function optimizePart (prePart, current, postPart, elements) { while (names.length) { const partial = current.replace(names.shift(), '').trim() var pattern = `${prePart}${partial}${postPart}`.trim() - if (!pattern.length || pattern.charAt(0) === '>' || pattern.charAt(pattern.length-1) === '>') { + if (!pattern.length || pattern.charAt(0) === '>' || pattern.charAt(pattern.length-1) === '>' || partial === '>') { break } var matches = document.querySelectorAll(pattern)