Skip to content

Commit

Permalink
Fixed icon parser issue when named slots were considered as icons
Browse files Browse the repository at this point in the history
  • Loading branch information
Explicit12 committed Jan 9, 2025
1 parent 6f35f83 commit 88278c7
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/assets/icons/vueless/edit.svg

This file was deleted.

1 change: 0 additions & 1 deletion src/assets/icons/vueless/expand.svg

This file was deleted.

1 change: 0 additions & 1 deletion src/assets/icons/vueless/label.svg

This file was deleted.

1 change: 0 additions & 1 deletion src/assets/icons/vueless/title.svg

This file was deleted.

5 changes: 3 additions & 2 deletions src/utils/node/loaderIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,14 @@ async function findAndCopyIcons(files) {
}

/* Vueless components props */
const uComponentIconNamePattern = `\\b\\w*(name|icon)\\w*\\s*=\\s*(['"])(.*?)\\2`;
const iconPropsPattern = `\\b\\w*(name|icon)\\w*\\s*=\\s*(['"])(.*?)\\2`;
const uComponentIconNamePattern = /<U\w+\s+.*?\b\w*(name|icon)\w*\s*[:=]\s*(['"])(.*?)\2.*?>/;
const uComponentIconNameArray = fileContents.match(new RegExp(uComponentIconNamePattern, "g"));

if (!uComponentIconNameArray) return;

for (const match of uComponentIconNameArray) {
const groupMatch = match.match(new RegExp(uComponentIconNamePattern));
const groupMatch = match.match(new RegExp(iconPropsPattern));
const iconName = groupMatch ? groupMatch[3] : null;

try {
Expand Down

0 comments on commit 88278c7

Please sign in to comment.