Skip to content

Commit d81a08a

Browse files
committed
fix: markdown render compatiblity
1 parent b675446 commit d81a08a

File tree

3 files changed

+25
-130
lines changed

3 files changed

+25
-130
lines changed

src/module.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,10 @@ export default defineNuxtModule<ModuleOptions>({
619619
await installModule('nuxt-mdc', {
620620
remarkPlugins: contentContext.markdown.remarkPlugins,
621621
rehypePlugins: contentContext.markdown.rehypePlugins,
622-
highlight: contentContext.highlight
622+
highlight: contentContext.highlight,
623+
components: {
624+
map: contentContext.markdown.tags
625+
}
623626
})
624627

625628
nuxt.options.runtimeConfig.public.content = defu(nuxt.options.runtimeConfig.public.content, {
+21-18
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
1-
<template>
2-
<MDCSlot :use="use" :unwrap="unwrap" />
3-
</template>
1+
<script lang="ts">
2+
import { defineComponent, h, resolveComponent } from 'vue'
43
5-
<script setup lang="ts">
6-
defineProps({
7-
/**
8-
* A slot name or function
9-
*/
10-
use: {
11-
type: Function,
12-
default: undefined
4+
export default defineComponent({
5+
props: {
6+
/**
7+
* A slot name or function
8+
*/
9+
use: {
10+
type: Function,
11+
default: undefined
12+
},
13+
/**
14+
* Tags to unwrap separated by spaces
15+
* Example: 'ul li'
16+
*/
17+
unwrap: {
18+
type: [Boolean, String],
19+
default: false
20+
}
1321
},
14-
/**
15-
* Tags to unwrap separated by spaces
16-
* Example: 'ul li'
17-
*/
18-
unwrap: {
19-
type: [Boolean, String],
20-
default: false
22+
render (props: any) {
23+
return h(resolveComponent('MDCSlot'), props)
2124
}
2225
})
2326
</script>

src/runtime/markdown-parser/index.ts

-111
This file was deleted.

0 commit comments

Comments
 (0)