|
|
@@ -1,6 +1,6 @@
|
|
|
import { useEffect, useState } from 'react';
|
|
|
|
|
|
-import type { Parent } from 'mdast';
|
|
|
+import type { Parent, Root } from 'mdast';
|
|
|
import type { Processor } from 'unified';
|
|
|
|
|
|
type ParseResult = {
|
|
|
@@ -40,7 +40,7 @@ const generateFrontmatterProcessor = async(opts?: ProcessorOpts) => {
|
|
|
const remarkStringify = (await import('remark-stringify')).default;
|
|
|
const unified = (await import('unified')).unified;
|
|
|
|
|
|
- return unified()
|
|
|
+ return (unified()
|
|
|
.use(remarkParse)
|
|
|
.use(remarkStringify)
|
|
|
.use(remarkFrontmatter, ['yaml'])
|
|
|
@@ -52,7 +52,7 @@ const generateFrontmatterProcessor = async(opts?: ProcessorOpts) => {
|
|
|
else {
|
|
|
opts?.onSkipped?.();
|
|
|
}
|
|
|
- }));
|
|
|
+ })));
|
|
|
};
|
|
|
|
|
|
export type UseSlide = {
|
|
|
@@ -66,7 +66,7 @@ export type UseSlide = {
|
|
|
*/
|
|
|
export const useSlidesByFrontmatter = (markdown?: string, isEnabledMarp?: boolean): UseSlide | undefined => {
|
|
|
|
|
|
- const [processor, setProcessor] = useState<Processor|undefined>();
|
|
|
+ const [processor, setProcessor] = useState<Processor<Root, undefined, undefined, Root, string>|undefined>();
|
|
|
const [parseResult, setParseResult] = useState<UseSlide|undefined>();
|
|
|
|
|
|
useEffect(() => {
|