File tree Expand file tree Collapse file tree 3 files changed +19
-6
lines changed
Expand file tree Collapse file tree 3 files changed +19
-6
lines changed Original file line number Diff line number Diff line change 5151 < textarea cols ="50 " rows ="10 "> The examples can be found here.</ textarea >
5252
5353 < script type ="module ">
54- // import subscribe from '../dist/index.esm.js'
55- import subscribe from 'https://unpkg.com/@github/paste-markdown/dist/index.esm.js'
54+ // import { subscribe, installLink} from '../dist/index.esm.js'
55+ import { subscribe , installLink } from 'https://unpkg.com/@github/paste-markdown/dist/index.esm.js'
5656 subscribe ( document . querySelector ( 'textarea' ) )
57+ installLink ( document . querySelector ( 'textarea' ) )
5758 </ script >
5859</ body >
5960</ html >
Original file line number Diff line number Diff line change @@ -7,18 +7,28 @@ interface Subscription {
77 unsubscribe : ( ) => void
88}
99
10- export default function subscribe ( el : HTMLElement ) : Subscription {
10+ function subscribe ( el : HTMLElement ) : Subscription {
1111 installTable ( el )
1212 installImageLink ( el )
13- installLink ( el )
1413 installText ( el )
1514
1615 return {
1716 unsubscribe : ( ) => {
1817 uninstallTable ( el )
1918 uninstallImageLink ( el )
20- uninstallLink ( el )
2119 uninstallText ( el )
2220 }
2321 }
2422}
23+
24+ export {
25+ subscribe ,
26+ installImageLink ,
27+ installLink ,
28+ installTable ,
29+ installText ,
30+ uninstallImageLink ,
31+ uninstallTable ,
32+ uninstallLink ,
33+ uninstallText
34+ }
Original file line number Diff line number Diff line change 1- import subscribe from '../dist/index.esm.js'
1+ import { subscribe , installLink , uninstallLink } from '../dist/index.esm.js'
22
33describe ( 'paste-markdown' , function ( ) {
44 describe ( 'installed on textarea' , function ( ) {
@@ -10,10 +10,12 @@ describe('paste-markdown', function () {
1010
1111 textarea = document . querySelector ( 'textarea[data-paste-markdown]' )
1212 subscription = subscribe ( textarea )
13+ installLink ( textarea )
1314 } )
1415
1516 afterEach ( function ( ) {
1617 subscription . unsubscribe ( )
18+ uninstallLink ( textarea )
1719 document . body . innerHTML = ''
1820 } )
1921
You can’t perform that action at this time.
0 commit comments