Skip to content

Commit

Permalink
Bug fix autarc#82
Browse files Browse the repository at this point in the history
  • Loading branch information
qmegas authored Jul 31, 2023
1 parent 7090638 commit 026dc1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/optimize.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 026dc1b

Please sign in to comment.