Skip to content

Commit d4c60b1

Browse files
committed
Add test for turning pasted urls on selected text into markdown links
1 parent 460e1b6 commit d4c60b1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ describe('paste-markdown', function () {
2222
assert.include(textarea.value, '![](https://github.com/github.png)\n\n![](https://github.com/hubot.png)')
2323
})
2424

25+
it('turns pasted urls on selected text into markdown links', function () {
26+
textarea.value = 'The examples can be found here.'
27+
textarea.setSelectionRange(26, 30)
28+
paste(textarea, {'text/plain': 'https://github.com'})
29+
assert.equal(textarea.value, 'The examples can be found [here](https://github.com).')
30+
})
31+
2532
it('turns html tables into markdown', function () {
2633
const data = {
2734
'text/html': `

0 commit comments

Comments
 (0)