Skip to content

Commit a082bb3

Browse files
authored
Fix classRegex error (#501)
1 parent 4be5d9d commit a082bb3

File tree

1 file changed

+4
-4
lines changed
  • packages/tailwindcss-language-service/src/util

1 file changed

+4
-4
lines changed

packages/tailwindcss-language-service/src/util/find.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -133,19 +133,19 @@ async function findCustomClassLists(
133133
try {
134134
let [containerRegex, classRegex] = Array.isArray(regexes[i]) ? regexes[i] : [regexes[i]]
135135

136-
containerRegex = createMultiRegexp(containerRegex)
136+
let containerRegex2 = createMultiRegexp(containerRegex)
137137
let containerMatch
138138

139-
while ((containerMatch = containerRegex.exec(text)) !== null) {
139+
while ((containerMatch = containerRegex2.exec(text)) !== null) {
140140
const searchStart = doc.offsetAt(range?.start || { line: 0, character: 0 })
141141
const matchStart = searchStart + containerMatch.start
142142
const matchEnd = searchStart + containerMatch.end
143143

144144
if (classRegex) {
145-
classRegex = createMultiRegexp(classRegex)
145+
let classRegex2 = createMultiRegexp(classRegex)
146146
let classMatch
147147

148-
while ((classMatch = classRegex.exec(containerMatch.match)) !== null) {
148+
while ((classMatch = classRegex2.exec(containerMatch.match)) !== null) {
149149
const classMatchStart = matchStart + classMatch.start
150150
const classMatchEnd = matchStart + classMatch.end
151151
result.push({

0 commit comments

Comments
 (0)