Skip to content

Commit

Permalink
fix: css classes parsing (#1485)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-labs committed Jun 26, 2022
1 parent 0b71d8c commit 753a800
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vue-typescript/src/utils/parseCssClassNames.ts
Expand Up @@ -2,11 +2,11 @@ import { clearComments } from './parseCssVars';

export function* parseCssClassNames(styleContent: string) {
styleContent = clearComments(styleContent);
const cssClassNameRegex = /\.([\w-]+)/g;
const cssClassNameRegex = /(?=([\.]{1}[a-zA-Z_]+[\w\_\-]*)[\s\.\+\{\>#\:]{1})/g;
const matchs = styleContent.matchAll(cssClassNameRegex);
for (const match of matchs) {
if (match.index !== undefined) {
const matchText = match[0];
const matchText = match[1];
if (matchText !== undefined) {
yield { start: match.index, end: match.index + matchText.length };
}
Expand Down

0 comments on commit 753a800

Please sign in to comment.