Skip to content

Commit

Permalink
Add test for ambiguous links
Browse files Browse the repository at this point in the history
  • Loading branch information
yujinakayama committed Oct 24, 2016
1 parent 98caa0d commit 46c9efa
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions test/tasklist_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,37 @@ describe('tasklist', function () {
});
});

context('with list of links', function () {
it('does not confuse the links with checkboxes', function () {
assert.equal(
tasklist.convert(
'- [x](/inline/link)\n' +
'- [x] (/inline/link)\n' +
'- [x][reference-link]\n' +
'- [x] [reference-link]\n' +
'- [x][]\n' +
'- [x] []\n' +
'- [x] Checkbox\n' +
'\n' +
'[reference-link]: http://qiita.com/\n' +
'[x]: http://qiita.com/\n',
1,
false
),
'- [x](/inline/link)\n' +
'- [x] (/inline/link)\n' +
'- [x][reference-link]\n' +
'- [x] [reference-link]\n' +
'- [x][]\n' +
'- [x] []\n' +
'- [ ] Checkbox\n' +
'\n' +
'[reference-link]: http://qiita.com/\n' +
'[x]: http://qiita.com/\n'
);
});
});

context('with code block', function () {
it('ignores tasklist in code block', function () {
assert.equal(
Expand Down

0 comments on commit 46c9efa

Please sign in to comment.