11import subscribe from '../dist/index.esm.js'
22
33describe ( 'paste-markdown' , function ( ) {
4- describe ( 'with quotable selection ' , function ( ) {
4+ describe ( 'installed on textarea ' , function ( ) {
55 let subscription , textarea
66 beforeEach ( function ( ) {
77 document . body . innerHTML = `
@@ -17,17 +17,12 @@ describe('paste-markdown', function() {
1717 document . body . innerHTML = ''
1818 } )
1919
20- it ( 'pastes image uris as markdown' , function ( ) {
20+ it ( 'turns image uris into markdown' , function ( ) {
2121 paste ( textarea , { 'text/uri-list' : 'https://github.com/github.png\r\nhttps://github.com/hubot.png' } )
2222 assert . include ( textarea . value , '\n\n' )
2323 } )
2424
25- it ( 'pastes gfm into markdown' , function ( ) {
26- paste ( textarea , { 'text/plain' : 'hello' , 'text/x-gfm' : '# hello' } )
27- assert . include ( textarea . value , '# hello' )
28- } )
29-
30- it ( 'pastes html tables as markdown' , function ( ) {
25+ it ( 'turns html tables into markdown' , function ( ) {
3126 const data = {
3227 'text/html' : `
3328 <table>
@@ -43,7 +38,7 @@ describe('paste-markdown', function() {
4338 assert . include ( textarea . value , 'name | origin\n-- | --\nhubot | github\nbender | futurama' )
4439 } )
4540
46- it ( 'does not paste excluded content as markdown ' , function ( ) {
41+ it ( 'rejects HTML from github.com markup ' , function ( ) {
4742 const data = {
4843 'text/html' : `
4944 <table class="js-comment">
@@ -58,6 +53,11 @@ describe('paste-markdown', function() {
5853 paste ( textarea , data )
5954 assert . equal ( textarea . value , '' )
6055 } )
56+
57+ it ( 'accepts x-gfm' , function ( ) {
58+ paste ( textarea , { 'text/plain' : 'hello' , 'text/x-gfm' : '# hello' } )
59+ assert . include ( textarea . value , '# hello' )
60+ } )
6161 } )
6262} )
6363
0 commit comments