@nuxtjs/mdc 0.2.4 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.json +1 -1
- package/dist/runtime/components/MDC.vue +5 -2
- package/dist/runtime/components/prose/ProseScript.vue +5 -2
- package/dist/runtime/parser/toc.d.ts +1 -1
- package/dist/runtime/parser/utils/plugins.d.ts +2 -2
- package/dist/runtime/types/parser.d.ts +1 -1
- package/package.json +2 -2
package/dist/module.json
CHANGED
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
:excerpt="data?.excerpt"
|
|
7
7
|
>
|
|
8
8
|
<MDCRenderer
|
|
9
|
+
v-if="body"
|
|
9
10
|
:tag="tag"
|
|
10
11
|
:class="props.class"
|
|
11
|
-
:body="
|
|
12
|
+
:body="body"
|
|
12
13
|
:data="data?.data"
|
|
13
14
|
/>
|
|
14
15
|
</slot>
|
|
@@ -23,7 +24,7 @@ import type { MDCParseOptions } from '../types'
|
|
|
23
24
|
|
|
24
25
|
const props = defineProps({
|
|
25
26
|
tag: {
|
|
26
|
-
type: String,
|
|
27
|
+
type: [String, Boolean],
|
|
27
28
|
default: 'div'
|
|
28
29
|
},
|
|
29
30
|
/**
|
|
@@ -65,6 +66,8 @@ const { data, refresh } = await useAsyncData(key.value, async () => {
|
|
|
65
66
|
return await parseMarkdown(props.value, props.parserOptions)
|
|
66
67
|
})
|
|
67
68
|
|
|
69
|
+
const body = computed(() => props.excerpt ? data.value?.excerpt : data.value?.body)
|
|
70
|
+
|
|
68
71
|
watch(() => props.value, () => {
|
|
69
72
|
refresh()
|
|
70
73
|
})
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div>
|
|
3
|
-
Rendering the <
|
|
2
|
+
<div v-if="isDev">
|
|
3
|
+
Rendering the <code>script</code> element is dangerous and is disabled by default. Consider implementing your own <code>ProseScript</code> element to have control over script rendering.
|
|
4
4
|
</div>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script setup lang="ts">
|
|
8
|
+
import { computed } from 'vue'
|
|
9
|
+
|
|
8
10
|
defineProps({
|
|
9
11
|
src: {
|
|
10
12
|
type: String,
|
|
11
13
|
default: ''
|
|
12
14
|
}
|
|
13
15
|
})
|
|
16
|
+
const isDev = computed(() => process.dev)
|
|
14
17
|
</script>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { MDCNode, Toc, MDCElement, MDCRoot } from '../types';
|
|
1
|
+
import type { MDCNode, Toc, MDCElement, MDCRoot } from '../types';
|
|
2
2
|
export declare function generateFlatToc(body: MDCNode, options: Toc): Toc;
|
|
3
3
|
export declare function generateToc(body: MDCElement | MDCRoot, options: Toc): Toc;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Processor } from 'remark-rehype/lib';
|
|
2
|
-
import { MDCParseOptions } from '../../types';
|
|
1
|
+
import type { Processor } from 'remark-rehype/lib';
|
|
2
|
+
import type { MDCParseOptions } from '../../types';
|
|
3
3
|
export declare const useProcessorPlugins: (processor: Processor, plugins?: Exclude<MDCParseOptions['rehype'] | MDCParseOptions['remark'], undefined>['plugins']) => Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Options as RehypeOption } from 'remark-rehype';
|
|
2
|
-
import { Theme, Highlighter } from '../shiki/types';
|
|
2
|
+
import type { Theme, Highlighter } from '../shiki/types';
|
|
3
3
|
export interface RemarkPlugin {
|
|
4
4
|
instance?: any;
|
|
5
5
|
options?: Array<any> | Record<string, any>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxtjs/mdc",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Nuxt MDC module",
|
|
5
5
|
"repository": "nuxt-modules/mdc",
|
|
6
6
|
"license": "MIT",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@nuxt/test-utils": "^3.8.0",
|
|
74
74
|
"@nuxthq/ui": "^2.7.0",
|
|
75
75
|
"@types/mdurl": "^1.0.4",
|
|
76
|
-
"@types/node": "^20.8.
|
|
76
|
+
"@types/node": "^20.8.9",
|
|
77
77
|
"changelogen": "^0.5.5",
|
|
78
78
|
"eslint": "^8.52.0",
|
|
79
79
|
"nuxt": "^3.8.0",
|