allow whitespace around class attribute `=` (#426)

master
Brad Cornes 2021-10-04 18:14:24 +01:00
parent 8c299f96a9
commit d641b8eb2b
2 changed files with 2 additions and 2 deletions

View File

@ -338,7 +338,7 @@ function provideClassAttributeCompletions(
end: position,
})
const match = findLast(/(?:\s|:|\()(?:class(?:Name)?|\[ngClass\])=['"`{]/gi, str)
const match = findLast(/(?:\s|:|\()(?:class(?:Name)?|\[ngClass\])\s*=\s*['"`{]/gi, str)
if (match === null) {
return null

View File

@ -174,7 +174,7 @@ async function findCustomClassLists(
export function findClassListsInHtmlRange(doc: TextDocument, range?: Range): DocumentClassList[] {
const text = doc.getText(range)
const matches = findAll(/(?:\s|:|\()(?:class(?:Name)?|\[ngClass\])=['"`{]/g, text)
const matches = findAll(/(?:\s|:|\()(?:class(?:Name)?|\[ngClass\])\s*=\s*['"`{]/gi, text)
const result: DocumentClassList[] = []
matches.forEach((match) => {