Skip to content

Commit 4bfbe5d

Browse files
authored
Update update-readme.js
1 parent e92a182 commit 4bfbe5d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

update-readme.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if (!sectionMatch) {
1515
const pluginsListContent = sectionMatch[1].trim();
1616

1717
// Regex to match individual plugin entries
18-
const pluginRegex = /- ### (.+?)/g;
18+
const pluginRegex = /- ### \[(.+?)\]/g;
1919
const pluginNames = [];
2020
let match;
2121

@@ -50,11 +50,11 @@ parsedBadges.forEach(({ name, latestReleaseUrl }) => {
5050
console.log(`Matching plugin found in README for ${name}`);
5151

5252
// Construct the expected badge URL
53-
const expectedBadgeUrl = `https://img.shields.io/github/downloads/${name}/total`;
53+
const expectedBadgeUrl = `https://img.shields.io/github/downloads/${normalizedPluginName}/total`;
5454

5555
// Regex to find and replace badge and download URL
5656
const badgeRegex = new RegExp(
57-
`\!\GitHub Downloads \all releases\\\https://img\\.shields\\.io/github/downloads/.+?/total\\\.*?\`,
57+
`\\[!\\[GitHub Downloads \\(all releases\\)\\]\\(https://img\\.shields\\.io/github/downloads/.+?/total\\)\\]\\(.*?\\)`,
5858
'g'
5959
);
6060
const newBadge = `[![GitHub Downloads (all releases)](${expectedBadgeUrl})](${latestReleaseUrl})`;

0 commit comments

Comments
 (0)