Skip to content

Commit e6a3719

Browse files
committed
update class attribute regex
1 parent 99febcd commit e6a3719

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/tailwindcss-language-service/src/completionProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ function provideClassAttributeCompletions(
159159
end: position,
160160
})
161161

162-
const match = findLast(/(?:\b|:)class(?:Name)?=['"`{]/gi, str)
162+
const match = findLast(/(?:\s|:)class(?:Name)?=['"`{]/gi, str)
163163

164164
if (match === null) {
165165
return null

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export function findClassListsInHtmlRange(
135135
range?: Range
136136
): DocumentClassList[] {
137137
const text = doc.getText(range)
138-
const matches = findAll(/(?:\b|:)class(?:Name)?=['"`{]/g, text)
138+
const matches = findAll(/(?:\s|:)class(?:Name)?=['"`{]/g, text)
139139
const result: DocumentClassList[] = []
140140

141141
matches.forEach((match) => {

0 commit comments

Comments
 (0)