From 46c9efa6deced6e01e630456ce3819dea7a1b111 Mon Sep 17 00:00:00 2001 From: Yuji Nakayama Date: Mon, 24 Oct 2016 13:55:33 +0900 Subject: [PATCH] Add test for ambiguous links --- test/tasklist_test.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/test/tasklist_test.js b/test/tasklist_test.js index b34dad6..b31f685 100644 --- a/test/tasklist_test.js +++ b/test/tasklist_test.js @@ -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(