update class attribute regex (#233)

master
Brad Cornes 2021-01-08 15:53:02 +00:00
parent b3c17cf5c9
commit 0e66dac7b7
2 changed files with 5 additions and 2 deletions

View File

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

View File

@ -209,7 +209,7 @@ export function findClassListsInHtmlRange(
): DocumentClassList[] {
const text = doc.getText(range)
const matches = findAll(
/(?:\s|:)(?:class(?:Name)?|\[ngClass\])=['"`{]/g,
/(?:\s|:|\()(?:class(?:Name)?|\[ngClass\])=['"`{]/g,
text
)
const result: DocumentClassList[] = []