Skip to content

Commit d641b8e

Browse files
committed
allow whitespace around class attribute = (#426)
1 parent 8c299f9 commit d641b8e

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
@@ -338,7 +338,7 @@ function provideClassAttributeCompletions(
338338
end: position,
339339
})
340340

341-
const match = findLast(/(?:\s|:|\()(?:class(?:Name)?|\[ngClass\])=['"`{]/gi, str)
341+
const match = findLast(/(?:\s|:|\()(?:class(?:Name)?|\[ngClass\])\s*=\s*['"`{]/gi, str)
342342

343343
if (match === null) {
344344
return null

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ async function findCustomClassLists(
174174

175175
export function findClassListsInHtmlRange(doc: TextDocument, range?: Range): DocumentClassList[] {
176176
const text = doc.getText(range)
177-
const matches = findAll(/(?:\s|:|\()(?:class(?:Name)?|\[ngClass\])=['"`{]/g, text)
177+
const matches = findAll(/(?:\s|:|\()(?:class(?:Name)?|\[ngClass\])\s*=\s*['"`{]/gi, text)
178178
const result: DocumentClassList[] = []
179179

180180
matches.forEach((match) => {

0 commit comments

Comments
 (0)