Skip to content
Permalink
Browse files

Add support for the new Awesome badge (#62)

Fixes #61
  • Loading branch information
damccorm authored and sindresorhus committed Feb 27, 2019
1 parent 6b61f1f commit 7d4176eabc9186145d2c7bfa771af1a2dcb69014
Showing with 22 additions and 1 deletion.
  1. +2 −1 rules/badge.js
  2. +15 −0 test/fixtures/badge/success2.md
  3. +5 −0 test/rules/badge.js
@@ -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);
@@ -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
@@ -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.
You can’t perform that action at this time.