@@ -33,17 +33,19 @@ async function content() {
33
33
return { blocks } ;
34
34
}
35
35
36
+ // TODO is this still used?
37
+
36
38
/** @param {string } markdown */
37
39
async function plaintext ( markdown ) {
38
- /** @param {unknown } text */
39
- const block = ( text ) => `${ text } \n` ;
40
+ /** @param {any } token */
41
+ const block = ( { text } ) => `${ text } \n` ;
40
42
41
- /** @param {string } text */
42
- const inline = ( text ) => text ;
43
+ /** @param {any } token */
44
+ const inline = ( { text } ) => text ;
43
45
44
46
return (
45
47
await markedTransform ( markdown , {
46
- code : ( source ) => source . split ( '// ---cut---\n' ) . pop ( ) ?? '' ,
48
+ code : ( { text } ) => text . split ( '// ---cut---\n' ) . pop ( ) ?? '' ,
47
49
blockquote : block ,
48
50
html : ( ) => '\n' ,
49
51
heading : ( text ) => `${ text } \n` ,
@@ -54,16 +56,16 @@ async function plaintext(markdown) {
54
56
paragraph : ( text ) => `${ text } \n\n` ,
55
57
table : block ,
56
58
tablerow : block ,
57
- tablecell : ( text , opts ) => {
59
+ tablecell : ( { text } ) => {
58
60
return text + ' ' ;
59
61
} ,
60
62
strong : inline ,
61
63
em : inline ,
62
64
codespan : inline ,
63
65
br : ( ) => '' ,
64
66
del : inline ,
65
- link : ( href , title , text ) => text ,
66
- image : ( href , title , text ) => text ,
67
+ link : inline ,
68
+ image : inline ,
67
69
text : inline
68
70
} )
69
71
)
0 commit comments