Skip to content

Commit

Permalink
fix: Make all contributors names bold (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
machour authored and Kent C. Dodds committed Nov 2, 2017
1 parent 28eb16d commit 07b3a68
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/generate/format-contributor.js
Expand Up @@ -4,7 +4,7 @@ var _ = require('lodash/fp');
var formatContributionType = require('./format-contribution-type');

var avatarTemplate = _.template('<img src="<%= contributor.avatar_url %>" width="<%= options.imageSize %>px;"/>');
var avatarBlockTemplate = _.template('[<%= avatar %><br /><sub><%= name %></sub>](<%= contributor.profile %>)');
var avatarBlockTemplate = _.template('[<%= avatar %><br /><sub><b><%= name %></b></sub>](<%= contributor.profile %>)');
var contributorTemplate = _.template('<%= avatarBlock %><br /><%= contributions %>');

var defaultImageSize = 100;
Expand Down
8 changes: 4 additions & 4 deletions lib/generate/format-contributor.test.js
Expand Up @@ -16,7 +16,7 @@ test('should format a simple contributor', t => {
const contributor = _.assign(contributors.kentcdodds, {contributions: ['review']});
const {options} = fixtures();

const expected = '[<img src="https://avatars1.githubusercontent.com/u/1500684" width="150px;"/><br /><sub>Kent C. Dodds</sub>](http://kentcdodds.com)<br />[👀](#review-kentcdodds "Reviewed Pull Requests")';
const expected = '[<img src="https://avatars1.githubusercontent.com/u/1500684" width="150px;"/><br /><sub><b>Kent C. Dodds</b></sub>](http://kentcdodds.com)<br />[👀](#review-kentcdodds "Reviewed Pull Requests")';

t.is(formatContributor(options, contributor), expected);
});
Expand All @@ -25,7 +25,7 @@ test('should format contributor with complex contribution types', t => {
const contributor = contributors.kentcdodds;
const {options} = fixtures();

const expected = '[<img src="https://avatars1.githubusercontent.com/u/1500684" width="150px;"/><br /><sub>Kent C. Dodds</sub>](http://kentcdodds.com)<br />[📖](https://github.com/jfmengels/all-contributors-cli/commits?author=kentcdodds "Documentation") [👀](#review-kentcdodds "Reviewed Pull Requests") [💬](#question-kentcdodds "Answering Questions")';
const expected = '[<img src="https://avatars1.githubusercontent.com/u/1500684" width="150px;"/><br /><sub><b>Kent C. Dodds</b></sub>](http://kentcdodds.com)<br />[📖](https://github.com/jfmengels/all-contributors-cli/commits?author=kentcdodds "Documentation") [👀](#review-kentcdodds "Reviewed Pull Requests") [💬](#question-kentcdodds "Answering Questions")';

t.is(formatContributor(options, contributor), expected);
});
Expand All @@ -45,7 +45,7 @@ test('should default image size to 100', t => {
const {options} = fixtures();
delete options.imageSize;

const expected = '[<img src="https://avatars1.githubusercontent.com/u/1500684" width="100px;"/><br /><sub>Kent C. Dodds</sub>](http://kentcdodds.com)<br />[👀](#review-kentcdodds "Reviewed Pull Requests")';
const expected = '[<img src="https://avatars1.githubusercontent.com/u/1500684" width="100px;"/><br /><sub><b>Kent C. Dodds</b></sub>](http://kentcdodds.com)<br />[👀](#review-kentcdodds "Reviewed Pull Requests")';

t.is(formatContributor(options, contributor), expected);
});
Expand All @@ -54,7 +54,7 @@ test('should format contributor with pipes in their name', t => {
const contributor = contributors.pipey;
const {options} = fixtures();

const expected = '[<img src="https://avatars1.githubusercontent.com/u/1500684" width="150px;"/><br /><sub>Who &#124; Needs &#124; Pipes?</sub>](http://github.com/chrisinajar)<br />[📖](https://github.com/jfmengels/all-contributors-cli/commits?author=pipey "Documentation")';
const expected = '[<img src="https://avatars1.githubusercontent.com/u/1500684" width="150px;"/><br /><sub><b>Who &#124; Needs &#124; Pipes?</b></sub>](http://github.com/chrisinajar)<br />[📖](https://github.com/jfmengels/all-contributors-cli/commits?author=pipey "Documentation")';

t.is(formatContributor(options, contributor), expected);
});

0 comments on commit 07b3a68

Please sign in to comment.