Skip to content

Commit 4f08f62

Browse files
committed
more
1 parent 77a80cf commit 4f08f62

File tree

1 file changed

+10
-8
lines changed
  • apps/svelte.dev/src/routes/tutorial/content.json

1 file changed

+10
-8
lines changed

apps/svelte.dev/src/routes/tutorial/content.json/+server.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,19 @@ async function content() {
3333
return { blocks };
3434
}
3535

36+
// TODO is this still used?
37+
3638
/** @param {string} markdown */
3739
async function plaintext(markdown) {
38-
/** @param {unknown} text */
39-
const block = (text) => `${text}\n`;
40+
/** @param {any} token */
41+
const block = ({ text }) => `${text}\n`;
4042

41-
/** @param {string} text */
42-
const inline = (text) => text;
43+
/** @param {any} token */
44+
const inline = ({ text }) => text;
4345

4446
return (
4547
await markedTransform(markdown, {
46-
code: (source) => source.split('// ---cut---\n').pop() ?? '',
48+
code: ({ text }) => text.split('// ---cut---\n').pop() ?? '',
4749
blockquote: block,
4850
html: () => '\n',
4951
heading: (text) => `${text}\n`,
@@ -54,16 +56,16 @@ async function plaintext(markdown) {
5456
paragraph: (text) => `${text}\n\n`,
5557
table: block,
5658
tablerow: block,
57-
tablecell: (text, opts) => {
59+
tablecell: ({ text }) => {
5860
return text + ' ';
5961
},
6062
strong: inline,
6163
em: inline,
6264
codespan: inline,
6365
br: () => '',
6466
del: inline,
65-
link: (href, title, text) => text,
66-
image: (href, title, text) => text,
67+
link: inline,
68+
image: inline,
6769
text: inline
6870
})
6971
)

0 commit comments

Comments
 (0)