Skip to content

Commit

Permalink
fix: parse markdown in toc (#813)
Browse files Browse the repository at this point in the history
  • Loading branch information
tonai authored Jan 10, 2023
1 parent 9f08aca commit ebfaf8f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions packages/client/builtin/TocList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,9 @@ const classes = computed(() => {
</li>
</ol>
</template>

<style>
.slidev-toc-item p {
margin: 0;
}
</style>
6 changes: 5 additions & 1 deletion packages/slidev/node/plugins/loaders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,11 @@ export function createSlidesLoader(
if (id === '/@slidev/titles.md') {
return {
code: data.slides.map(({ title }, i) => {
return `<template ${i === 0 ? 'v-if' : 'v-else-if'}="+no === ${i + 1}">${title}</template>`
return `<template ${i === 0 ? 'v-if' : 'v-else-if'}="+no === ${i + 1}">
${title}
</template>`
}).join(''),
map: { mappings: '' },
}
Expand Down

0 comments on commit ebfaf8f

Please sign in to comment.