Skip to content

Commit

Permalink
fix(issues): correctly parses multiple issues in same comment
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Aug 17, 2016
1 parent 0c35084 commit 0f92238
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/replace-links-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ describe('replace links', () => {
la(r === '(a360d56e, closes #11)', r);
});

it('replaces several issue links', () => {
const s = 'closes [#11](https://github.com/bahmutov/manpm/issues/11),' +
' and fixes [#12](https://github.com/bahmutov/manpm/issues/12)';
const r = replaceLinks(s);
la(r === 'closes #11, and fixes #12', r);
});

it('handles dashes', () => {
const s = 'release [17713ca1](https://github.com/bahmutov/lazy-ass/commit/17713ca1)';
const r = replaceLinks(s);
Expand Down
2 changes: 1 addition & 1 deletion src/replace-links.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function replaceIssueLinks(s) {
if (!match) {
return s;
}
return s.replace(match[0], match[1]);
return replaceIssueLinks(s.replace(match[0], match[1]));
}

// replace urls like
Expand Down

0 comments on commit 0f92238

Please sign in to comment.