Fix `classRegex` offset (#846)

master
Brad Cornes 2023-08-21 13:05:27 +01:00 committed by GitHub
parent 5faf811489
commit 4c702acf85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -148,7 +148,7 @@ async function findCustomClassLists(
let containerMatch: ReturnType<Regex['exec']> let containerMatch: ReturnType<Regex['exec']>
while ((containerMatch = containerRegex.exec(text)) !== null) { while ((containerMatch = containerRegex.exec(text)) !== null) {
const searchStart = doc.offsetAt(range?.start || { line: 0, character: 0 }) const searchStart = doc.offsetAt({ line: 0, character: 0 })
const matchStart = searchStart + containerMatch.index[1] const matchStart = searchStart + containerMatch.index[1]
const matchEnd = matchStart + containerMatch[1].length const matchEnd = matchStart + containerMatch[1].length