Fix `classRegex` error (#501)

master
Brad Cornes 2022-02-28 13:49:07 +00:00 committed by GitHub
parent 4be5d9d082
commit a082bb3fd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -133,19 +133,19 @@ async function findCustomClassLists(
try {
let [containerRegex, classRegex] = Array.isArray(regexes[i]) ? regexes[i] : [regexes[i]]
containerRegex = createMultiRegexp(containerRegex)
let containerRegex2 = createMultiRegexp(containerRegex)
let containerMatch
while ((containerMatch = containerRegex.exec(text)) !== null) {
while ((containerMatch = containerRegex2.exec(text)) !== null) {
const searchStart = doc.offsetAt(range?.start || { line: 0, character: 0 })
const matchStart = searchStart + containerMatch.start
const matchEnd = searchStart + containerMatch.end
if (classRegex) {
classRegex = createMultiRegexp(classRegex)
let classRegex2 = createMultiRegexp(classRegex)
let classMatch
while ((classMatch = classRegex.exec(containerMatch.match)) !== null) {
while ((classMatch = classRegex2.exec(containerMatch.match)) !== null) {
const classMatchStart = matchStart + classMatch.start
const classMatchEnd = matchStart + classMatch.end
result.push({