Skip to content

Commit 54e3dee

Browse files
authoredNov 17, 2023
feat: port README.md badge underlines fix to templates (#1038)
<!-- 👋 Hi, thanks for sending a PR to create-typescript-app! 💖. Please fill out all fields below and make sure each item is true and [x] checked. Otherwise we may not be able to review your PR. --> ## PR Checklist - [x] Addresses an existing open issue: fixes #1032 - [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) - [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/.github/CONTRIBUTING.md) were taken ## Overview This PR ports README.md badge underlines fix (in #1030) to templates that generates the badges in README.md files and its associated test. 💖
1 parent bb5b357 commit 54e3dee

File tree

7 files changed

+102
-217
lines changed

7 files changed

+102
-217
lines changed
 

Diff for: ‎.all-contributorsrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"badgeTemplate": "<img alt=\"All Contributors: <%= contributors.length %> 🤝\" src=\"https://img.shields.io/badge/all_contributors-<%= contributors.length %>_🤝-21bb42.svg\" />",
2+
"badgeTemplate": "<a href=\"#contributors\" target=\"_blank\"><img alt=\"All Contributors: <%= contributors.length %> 🤝\" src=\"https://img.shields.io/badge/all_contributors-<%= contributors.length %>_🤝-21bb42.svg\" /></a>",
33
"commit": false,
44
"commitConvention": "angular",
55
"contributors": [

Diff for: ‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<p align="center">
66
<!-- prettier-ignore-start -->
77
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
8-
<img alt="All Contributors: 36 🤝" src="https://img.shields.io/badge/all_contributors-36_🤝-21bb42.svg" />
8+
<a href="#contributors" target="_blank"><img alt="All Contributors: 36 🤝" src="https://img.shields.io/badge/all_contributors-36_🤝-21bb42.svg" /></a>
99
<!-- ALL-CONTRIBUTORS-BADGE:END -->
1010
<!-- prettier-ignore-end -->
1111
<a href="https://codecov.io/gh/JoshuaKGoldberg/create-typescript-app" target="_blank"><img alt="Codecov Test Coverage" src="https://codecov.io/gh/JoshuaKGoldberg/create-typescript-app/branch/main/graph/badge.svg"/></a>

Diff for: ‎src/steps/writeReadme/findExistingBadges.test.ts

+14-40
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,12 @@ describe("findExistingBadges", () => {
3636
<!-- ALL-CONTRIBUTORS-BADGE:END -->
3737
<!-- prettier-ignore-end -->
3838
</a>`,
39-
` <a href="https://codecov.io/gh/JoshuaKGoldberg/all-contributors-auto-action" target="_blank">
40-
<img alt="Codecov Test Coverage" src="https://codecov.io/gh/JoshuaKGoldberg/all-contributors-auto-action/branch/main/graph/badge.svg"/>
41-
</a>`,
42-
` <a href="https://github.com/JoshuaKGoldberg/all-contributors-auto-action/blob/main/.github/CODE_OF_CONDUCT.md" target="_blank">
43-
<img alt="Contributor Covenant" src="https://img.shields.io/badge/code_of_conduct-enforced-21bb42" />
44-
</a>`,
39+
` <a href="https://codecov.io/gh/JoshuaKGoldberg/all-contributors-auto-action" target="_blank"><img alt="Codecov Test Coverage" src="https://codecov.io/gh/JoshuaKGoldberg/all-contributors-auto-action/branch/main/graph/badge.svg"/></a>`,
40+
` <a href="https://github.com/JoshuaKGoldberg/all-contributors-auto-action/blob/main/.github/CODE_OF_CONDUCT.md" target="_blank"><img alt="Contributor Covenant" src="https://img.shields.io/badge/code_of_conduct-enforced-21bb42" /></a>`,
4541
`
46-
<a href="https://github.com/JoshuaKGoldberg/all-contributors-auto-action/blob/main/LICENSE.md" target="_blank">
47-
<img alt="License: MIT" src="https://img.shields.io/github/license/JoshuaKGoldberg/all-contributors-auto-action?color=21bb42">
48-
</a>`,
42+
<a href="https://github.com/JoshuaKGoldberg/all-contributors-auto-action/blob/main/LICENSE.md" target="_blank"><img alt="License: MIT" src="https://img.shields.io/github/license/JoshuaKGoldberg/all-contributors-auto-action?color=21bb42"></a>`,
4943
`
50-
<a href="https://github.com/sponsors/JoshuaKGoldberg" target="_blank">
51-
<img alt="Sponsor: On GitHub" src="https://img.shields.io/badge/sponsor-on_github-21bb42.svg" />
52-
</a>`,
44+
<a href="https://github.com/sponsors/JoshuaKGoldberg" target="_blank"><img alt="Sponsor: On GitHub" src="https://img.shields.io/badge/sponsor-on_github-21bb42.svg" /></a>`,
5345
`<img alt="Style: Prettier" src="https://img.shields.io/badge/style-prettier-21bb42.svg" />`,
5446
`<img alt="TypeScript: Strict" src="https://img.shields.io/badge/typescript-strict-21bb42.svg" />`,
5547
])("%s", (contents) => {
@@ -85,44 +77,26 @@ describe("findExistingBadges", () => {
8577
expect(
8678
findExistingBadges(`
8779
<p align="center">
88-
<a href="#contributors" target="_blank">
8980
<!-- prettier-ignore-start -->
9081
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
91-
<img alt="All Contributors: 1" src="https://img.shields.io/badge/all_contributors-1-21bb42.svg" />
82+
<a href="#contributors" target="_blank"><img alt="All Contributors: 1" src="https://img.shields.io/badge/all_contributors-1-21bb42.svg" /></a>
9283
<!-- ALL-CONTRIBUTORS-BADGE:END -->
9384
<!-- prettier-ignore-end -->
94-
</a>
95-
<a href="https://codecov.io/gh/JoshuaKGoldberg/all-contributors-auto-action" target="_blank">
96-
<img alt="Codecov Test Coverage" src="https://codecov.io/gh/JoshuaKGoldberg/all-contributors-auto-action/branch/main/graph/badge.svg?token=eVIFY4MhfQ"/>
97-
</a>
98-
<a href="https://github.com/JoshuaKGoldberg/all-contributors-auto-action/blob/main/.github/CODE_OF_CONDUCT.md" target="_blank">
99-
<img alt="Contributor Covenant" src="https://img.shields.io/badge/code_of_conduct-enforced-21bb42" />
100-
</a>
101-
<a href="https://github.com/JoshuaKGoldberg/all-contributors-auto-action/blob/main/LICENSE.md" target="_blank">
102-
<img alt="License: MIT" src="https://img.shields.io/github/license/JoshuaKGoldberg/all-contributors-auto-action?color=21bb42">
103-
</a>
104-
<a href="https://github.com/sponsors/JoshuaKGoldberg" target="_blank">
105-
<img alt="Sponsor: On GitHub" src="https://img.shields.io/badge/sponsor-on_github-21bb42.svg" />
106-
</a>
85+
<a href="https://codecov.io/gh/JoshuaKGoldberg/all-contributors-auto-action" target="_blank"><img alt="Codecov Test Coverage" src="https://codecov.io/gh/JoshuaKGoldberg/all-contributors-auto-action/branch/main/graph/badge.svg?token=eVIFY4MhfQ"/></a>
86+
<a href="https://github.com/JoshuaKGoldberg/all-contributors-auto-action/blob/main/.github/CODE_OF_CONDUCT.md" target="_blank"><img alt="Contributor Covenant" src="https://img.shields.io/badge/code_of_conduct-enforced-21bb42" /></a>
87+
<a href="https://github.com/JoshuaKGoldberg/all-contributors-auto-action/blob/main/LICENSE.md" target="_blank"><img alt="License: MIT" src="https://img.shields.io/github/license/JoshuaKGoldberg/all-contributors-auto-action?color=21bb42"></a>
88+
<a href="https://github.com/sponsors/JoshuaKGoldberg" target="_blank"><img alt="Sponsor: On GitHub" src="https://img.shields.io/badge/sponsor-on_github-21bb42.svg" /></a>
10789
<img alt="Style: Prettier" src="https://img.shields.io/badge/style-prettier-21bb42.svg" />
108-
<img alt="TypeScript: Strict" src="https://img.shields.io/badge/typescript-strict-21bb42.svg" />
90+
<img alt="TypeScript: Strict" src="https://img.shields.io/badge/typescript-strict-21bb42.svg" />
10991
</p>
11092
`),
11193
).toMatchInlineSnapshot(`
11294
[
113-
"<a href=\\"#contributors\\" target=\\"_blank\\">
114-
<!-- prettier-ignore-start -->
115-
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
116-
<img alt=\\"All Contributors: 1\\" src=\\"https://img.shields.io/badge/all_contributors-1-21bb42.svg\\" />
117-
<!-- ALL-CONTRIBUTORS-BADGE:END -->
118-
<!-- prettier-ignore-end -->
119-
</a>",
120-
"<a href=\\"https://github.com/JoshuaKGoldberg/all-contributors-auto-action/blob/main/LICENSE.md\\" target=\\"_blank\\">
121-
<img alt=\\"License: MIT\\" src=\\"https://img.shields.io/github/license/JoshuaKGoldberg/all-contributors-auto-action?color=21bb42\\">
122-
</a>",
95+
"<a href=\\"#contributors\\" target=\\"_blank\\"><img alt=\\"All Contributors: 1\\" src=\\"https://img.shields.io/badge/all_contributors-1-21bb42.svg\\" /></a>",
96+
"<a href=\\"https://github.com/JoshuaKGoldberg/all-contributors-auto-action/blob/main/.github/CODE_OF_CONDUCT.md\\" target=\\"_blank\\"><img alt=\\"Contributor Covenant\\" src=\\"https://img.shields.io/badge/code_of_conduct-enforced-21bb42\\" /></a>",
97+
"<a href=\\"https://github.com/sponsors/JoshuaKGoldberg\\" target=\\"_blank\\"><img alt=\\"Sponsor: On GitHub\\" src=\\"https://img.shields.io/badge/sponsor-on_github-21bb42.svg\\" /></a>",
12398
"<img alt=\\"Codecov Test Coverage\\" src=\\"https://codecov.io/gh/JoshuaKGoldberg/all-contributors-auto-action/branch/main/graph/badge.svg?token=eVIFY4MhfQ\\"/>",
124-
"<img alt=\\"Sponsor: On GitHub\\" src=\\"https://img.shields.io/badge/sponsor-on_github-21bb42.svg\\" />",
125-
"<img alt=\\"TypeScript: Strict\\" src=\\"https://img.shields.io/badge/typescript-strict-21bb42.svg\\" />",
99+
"<img alt=\\"Style: Prettier\\" src=\\"https://img.shields.io/badge/style-prettier-21bb42.svg\\" />",
126100
]
127101
`);
128102
});

Diff for: ‎src/steps/writeReadme/generateTopContent.test.ts

+32-64
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,14 @@ describe("findExistingBadges", () => {
4747
<p align=\\"center\\"></p>
4848
4949
<p align=\\"center\\">
50-
<a href=\\"#contributors\\" target=\\"_blank\\">
51-
<!-- prettier-ignore-start -->
52-
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
53-
<img alt=\\"All Contributors: 2\\" src=\\"https://img.shields.io/badge/all_contributors-17-21bb42.svg\\" />
54-
<!-- ALL-CONTRIBUTORS-BADGE:END -->
55-
<!-- prettier-ignore-end -->
56-
</a>
57-
<a href=\\"https://codecov.io/gh//\\" target=\\"_blank\\">
58-
<img alt=\\"Codecov Test Coverage\\" src=\\"https://codecov.io/gh///branch/main/graph/badge.svg\\"/>
59-
</a>
60-
<a href=\\"https://github.com///blob/main/.github/CODE_OF_CONDUCT.md\\" target=\\"_blank\\">
61-
<img alt=\\"Contributor Covenant\\" src=\\"https://img.shields.io/badge/code_of_conduct-enforced-21bb42\\" />
62-
</a>
63-
<a href=\\"https://github.com///blob/main/LICENSE.md\\" target=\\"_blank\\">
64-
<img alt=\\"License: MIT\\" src=\\"https://img.shields.io/github/license//?color=21bb42\\">
65-
</a>
50+
<!-- prettier-ignore-start -->
51+
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
52+
<a href=\\"#contributors\\" target=\\"_blank\\"><img alt=\\"All Contributors: 2\\" src=\\"https://img.shields.io/badge/all_contributors-17-21bb42.svg\\" /></a>
53+
<!-- ALL-CONTRIBUTORS-BADGE:END -->
54+
<!-- prettier-ignore-end -->
55+
<a href=\\"https://codecov.io/gh//\\" target=\\"_blank\\"><img alt=\\"Codecov Test Coverage\\" src=\\"https://codecov.io/gh///branch/main/graph/badge.svg\\"/></a>
56+
<a href=\\"https://github.com///blob/main/.github/CODE_OF_CONDUCT.md\\" target=\\"_blank\\"><img alt=\\"Contributor Covenant\\" src=\\"https://img.shields.io/badge/code_of_conduct-enforced-21bb42\\" /></a>
57+
<a href=\\"https://github.com///blob/main/LICENSE.md\\" target=\\"_blank\\"><img alt=\\"License: MIT\\" src=\\"https://img.shields.io/github/license//?color=21bb42\\"></a>
6658
<img alt=\\"Style: Prettier\\" src=\\"https://img.shields.io/badge/style-prettier-21bb42.svg\\" />
6759
<img alt=\\"TypeScript: Strict\\" src=\\"https://img.shields.io/badge/typescript-strict-21bb42.svg\\" />
6860
<img alt=\\"npm package version\\" src=\\"https://img.shields.io/npm/v/create-typescript-app?color=21bb42\\" />
@@ -92,22 +84,14 @@ describe("findExistingBadges", () => {
9284
<p align=\\"center\\"></p>
9385
9486
<p align=\\"center\\">
95-
<a href=\\"#contributors\\" target=\\"_blank\\">
96-
<!-- prettier-ignore-start -->
97-
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
98-
<img alt=\\"All Contributors: 2\\" src=\\"https://img.shields.io/badge/all_contributors-17-21bb42.svg\\" />
99-
<!-- ALL-CONTRIBUTORS-BADGE:END -->
100-
<!-- prettier-ignore-end -->
101-
</a>
102-
<a href=\\"https://codecov.io/gh//\\" target=\\"_blank\\">
103-
<img alt=\\"Codecov Test Coverage\\" src=\\"https://codecov.io/gh///branch/main/graph/badge.svg\\"/>
104-
</a>
105-
<a href=\\"https://github.com///blob/main/.github/CODE_OF_CONDUCT.md\\" target=\\"_blank\\">
106-
<img alt=\\"Contributor Covenant\\" src=\\"https://img.shields.io/badge/code_of_conduct-enforced-21bb42\\" />
107-
</a>
108-
<a href=\\"https://github.com///blob/main/LICENSE.md\\" target=\\"_blank\\">
109-
<img alt=\\"License: MIT\\" src=\\"https://img.shields.io/github/license//?color=21bb42\\">
110-
</a>
87+
<!-- prettier-ignore-start -->
88+
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
89+
<a href=\\"#contributors\\" target=\\"_blank\\"><img alt=\\"All Contributors: 2\\" src=\\"https://img.shields.io/badge/all_contributors-17-21bb42.svg\\" /></a>
90+
<!-- ALL-CONTRIBUTORS-BADGE:END -->
91+
<!-- prettier-ignore-end -->
92+
<a href=\\"https://codecov.io/gh//\\" target=\\"_blank\\"><img alt=\\"Codecov Test Coverage\\" src=\\"https://codecov.io/gh///branch/main/graph/badge.svg\\"/></a>
93+
<a href=\\"https://github.com///blob/main/.github/CODE_OF_CONDUCT.md\\" target=\\"_blank\\"><img alt=\\"Contributor Covenant\\" src=\\"https://img.shields.io/badge/code_of_conduct-enforced-21bb42\\" /></a>
94+
<a href=\\"https://github.com///blob/main/LICENSE.md\\" target=\\"_blank\\"><img alt=\\"License: MIT\\" src=\\"https://img.shields.io/github/license//?color=21bb42\\"></a>
11195
<img alt=\\"Style: Prettier\\" src=\\"https://img.shields.io/badge/style-prettier-21bb42.svg\\" />
11296
<img alt=\\"TypeScript: Strict\\" src=\\"https://img.shields.io/badge/typescript-strict-21bb42.svg\\" />
11397
<img alt=\\"npm package version\\" src=\\"https://img.shields.io/npm/v/create-typescript-app?color=21bb42\\" />
@@ -137,22 +121,14 @@ describe("findExistingBadges", () => {
137121
<p align=\\"center\\"></p>
138122
139123
<p align=\\"center\\">
140-
<a href=\\"#contributors\\" target=\\"_blank\\">
141-
<!-- prettier-ignore-start -->
142-
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
143-
<img alt=\\"All Contributors: 2\\" src=\\"https://img.shields.io/badge/all_contributors-17-21bb42.svg\\" />
144-
<!-- ALL-CONTRIBUTORS-BADGE:END -->
145-
<!-- prettier-ignore-end -->
146-
</a>
147-
<a href=\\"https://codecov.io/gh//\\" target=\\"_blank\\">
148-
<img alt=\\"Codecov Test Coverage\\" src=\\"https://codecov.io/gh///branch/main/graph/badge.svg\\"/>
149-
</a>
150-
<a href=\\"https://github.com///blob/main/.github/CODE_OF_CONDUCT.md\\" target=\\"_blank\\">
151-
<img alt=\\"Contributor Covenant\\" src=\\"https://img.shields.io/badge/code_of_conduct-enforced-21bb42\\" />
152-
</a>
153-
<a href=\\"https://github.com///blob/main/LICENSE.md\\" target=\\"_blank\\">
154-
<img alt=\\"License: MIT\\" src=\\"https://img.shields.io/github/license//?color=21bb42\\">
155-
</a>
124+
<!-- prettier-ignore-start -->
125+
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
126+
<a href=\\"#contributors\\" target=\\"_blank\\"><img alt=\\"All Contributors: 2\\" src=\\"https://img.shields.io/badge/all_contributors-17-21bb42.svg\\" /></a>
127+
<!-- ALL-CONTRIBUTORS-BADGE:END -->
128+
<!-- prettier-ignore-end -->
129+
<a href=\\"https://codecov.io/gh//\\" target=\\"_blank\\"><img alt=\\"Codecov Test Coverage\\" src=\\"https://codecov.io/gh///branch/main/graph/badge.svg\\"/></a>
130+
<a href=\\"https://github.com///blob/main/.github/CODE_OF_CONDUCT.md\\" target=\\"_blank\\"><img alt=\\"Contributor Covenant\\" src=\\"https://img.shields.io/badge/code_of_conduct-enforced-21bb42\\" /></a>
131+
<a href=\\"https://github.com///blob/main/LICENSE.md\\" target=\\"_blank\\"><img alt=\\"License: MIT\\" src=\\"https://img.shields.io/github/license//?color=21bb42\\"></a>
156132
<img alt=\\"Style: Prettier\\" src=\\"https://img.shields.io/badge/style-prettier-21bb42.svg\\" />
157133
<img alt=\\"TypeScript: Strict\\" src=\\"https://img.shields.io/badge/typescript-strict-21bb42.svg\\" />
158134
<img alt=\\"npm package version\\" src=\\"https://img.shields.io/npm/v/create-typescript-app?color=21bb42\\" />
@@ -180,22 +156,14 @@ describe("findExistingBadges", () => {
180156
<p align=\\"center\\"></p>
181157
182158
<p align=\\"center\\">
183-
<a href=\\"#contributors\\" target=\\"_blank\\">
184-
<!-- prettier-ignore-start -->
185-
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
186-
<img alt=\\"All Contributors: 2\\" src=\\"https://img.shields.io/badge/all_contributors-17-21bb42.svg\\" />
187-
<!-- ALL-CONTRIBUTORS-BADGE:END -->
188-
<!-- prettier-ignore-end -->
189-
</a>
190-
<a href=\\"https://codecov.io/gh//\\" target=\\"_blank\\">
191-
<img alt=\\"Codecov Test Coverage\\" src=\\"https://codecov.io/gh///branch/main/graph/badge.svg\\"/>
192-
</a>
193-
<a href=\\"https://github.com///blob/main/.github/CODE_OF_CONDUCT.md\\" target=\\"_blank\\">
194-
<img alt=\\"Contributor Covenant\\" src=\\"https://img.shields.io/badge/code_of_conduct-enforced-21bb42\\" />
195-
</a>
196-
<a href=\\"https://github.com///blob/main/LICENSE.md\\" target=\\"_blank\\">
197-
<img alt=\\"License: MIT\\" src=\\"https://img.shields.io/github/license//?color=21bb42\\">
198-
</a>
159+
<!-- prettier-ignore-start -->
160+
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
161+
<a href=\\"#contributors\\" target=\\"_blank\\"><img alt=\\"All Contributors: 2\\" src=\\"https://img.shields.io/badge/all_contributors-17-21bb42.svg\\" /></a>
162+
<!-- ALL-CONTRIBUTORS-BADGE:END -->
163+
<!-- prettier-ignore-end -->
164+
<a href=\\"https://codecov.io/gh//\\" target=\\"_blank\\"><img alt=\\"Codecov Test Coverage\\" src=\\"https://codecov.io/gh///branch/main/graph/badge.svg\\"/></a>
165+
<a href=\\"https://github.com///blob/main/.github/CODE_OF_CONDUCT.md\\" target=\\"_blank\\"><img alt=\\"Contributor Covenant\\" src=\\"https://img.shields.io/badge/code_of_conduct-enforced-21bb42\\" /></a>
166+
<a href=\\"https://github.com///blob/main/LICENSE.md\\" target=\\"_blank\\"><img alt=\\"License: MIT\\" src=\\"https://img.shields.io/github/license//?color=21bb42\\"></a>
199167
<img alt=\\"Style: Prettier\\" src=\\"https://img.shields.io/badge/style-prettier-21bb42.svg\\" />
200168
<img alt=\\"TypeScript: Strict\\" src=\\"https://img.shields.io/badge/typescript-strict-21bb42.svg\\" />
201169
<img alt=\\"npm package version\\" src=\\"https://img.shields.io/npm/v/create-typescript-app?color=21bb42\\" />

Diff for: ‎src/steps/writeReadme/generateTopContent.ts

+9-19
Original file line numberDiff line numberDiff line change
@@ -24,39 +24,29 @@ export function generateTopContent(options: Options, existingBadges: string[]) {
2424
for (const [badgeLine, existingMatcher] of [
2525
[
2626
!options.excludeAllContributors &&
27-
`<a href="#contributors" target="_blank">
28-
<!-- prettier-ignore-start -->
29-
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
30-
<img alt="All Contributors: 2" src="https://img.shields.io/badge/all_contributors-17-21bb42.svg" />
31-
<!-- ALL-CONTRIBUTORS-BADGE:END -->
32-
<!-- prettier-ignore-end -->
33-
</a>`,
27+
`<!-- prettier-ignore-start -->
28+
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
29+
<a href="#contributors" target="_blank"><img alt="All Contributors: 2" src="https://img.shields.io/badge/all_contributors-17-21bb42.svg" /></a>
30+
<!-- ALL-CONTRIBUTORS-BADGE:END -->
31+
<!-- prettier-ignore-end -->`,
3432
/ALL-CONTRIBUTORS-BADGE:START/,
3533
],
3634
[
3735
!options.excludeTests &&
38-
`<a href="https://codecov.io/gh/${options.owner}/${options.repository}" target="_blank">
39-
<img alt="Codecov Test Coverage" src="https://codecov.io/gh/${options.owner}/${options.repository}/branch/main/graph/badge.svg"/>
40-
</a>`,
36+
`<a href="https://codecov.io/gh/${options.owner}/${options.repository}" target="_blank"><img alt="Codecov Test Coverage" src="https://codecov.io/gh/${options.owner}/${options.repository}/branch/main/graph/badge.svg"/></a>`,
4137
/https:\/\/codecov\.io\/gh/,
4238
],
4339
[
44-
`<a href="https://github.com/${options.owner}/${options.repository}/blob/main/.github/CODE_OF_CONDUCT.md" target="_blank">
45-
<img alt="Contributor Covenant" src="https://img.shields.io/badge/code_of_conduct-enforced-21bb42" />
46-
</a>`,
40+
`<a href="https://github.com/${options.owner}/${options.repository}/blob/main/.github/CODE_OF_CONDUCT.md" target="_blank"><img alt="Contributor Covenant" src="https://img.shields.io/badge/code_of_conduct-enforced-21bb42" /></a>`,
4741
/CODE_OF_CONDUCT\.md/,
4842
],
4943
[
50-
`<a href="https://github.com/${options.owner}/${options.repository}/blob/main/LICENSE.md" target="_blank">
51-
<img alt="License: MIT" src="https://img.shields.io/github/license/${options.owner}/${options.repository}?color=21bb42">
52-
</a>`,
44+
`<a href="https://github.com/${options.owner}/${options.repository}/blob/main/LICENSE.md" target="_blank"><img alt="License: MIT" src="https://img.shields.io/github/license/${options.owner}/${options.repository}?color=21bb42"></a>`,
5345
/LICENSE\.(md|txt)/,
5446
],
5547
[
5648
options.funding &&
57-
`<a href="https://github.com/sponsors/${options.funding}" target="_blank">
58-
<img alt="Sponsor: On GitHub" src="https://img.shields.io/badge/sponsor-on_github-21bb42.svg" />
59-
</a>`,
49+
`<a href="https://github.com/sponsors/${options.funding}" target="_blank"><img alt="Sponsor: On GitHub" src="https://img.shields.io/badge/sponsor-on_github-21bb42.svg" /></a>`,
6050
/github.+sponsors/,
6151
],
6252
[

0 commit comments

Comments
 (0)
Please sign in to comment.