Navigation Menu

Skip to content

Commit

Permalink
Add support for the new Awesome badge (#62)
Browse files Browse the repository at this point in the history
Fixes #61
  • Loading branch information
Danny McCormick authored and sindresorhus committed Feb 27, 2019
1 parent 6b61f1f commit 7d4176e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rules/badge.js
Expand Up @@ -9,7 +9,8 @@ const badgeUrlWhitelist = new Set([

const badgeSrcUrlWhitelist = new Set([
'https://awesome.re/badge.svg',
'https://awesome.re/badge-flat.svg'
'https://awesome.re/badge-flat.svg',
'https://awesome.re/badge-flat2.svg'
]);

const isValidBadgeUrl = url => badgeUrlWhitelist.has(url);
Expand Down
15 changes: 15 additions & 0 deletions test/fixtures/badge/success2.md
@@ -0,0 +1,15 @@
# Foo [![Awesome](https://awesome.re/badge-flat2.svg)](https://github.com/sindresorhus/awesome)

> Bar
## Contents

- [Foo](#foo)

## Foo

non-empty

## License

non-empty
5 changes: 5 additions & 0 deletions test/rules/badge.js
Expand Up @@ -47,3 +47,8 @@ test('badge - success (long)', async t => {
const messages = await lint({config, filename: 'test/fixtures/badge/success1.md'});
t.deepEqual(messages, []);
});

test('badge - success (new badge)', async t => {
const messages = await lint({config, filename: 'test/fixtures/badge/success2.md'});
t.deepEqual(messages, []);
});

0 comments on commit 7d4176e

Please sign in to comment.