reiji-h 1 год назад
Родитель
Сommit
2589ef1296
1 измененных файлов с 6 добавлено и 2 удалено
  1. 6 2
      packages/presentation/src/components/Presentation.tsx

+ 6 - 2
packages/presentation/src/components/Presentation.tsx

@@ -3,6 +3,7 @@ import React, { useEffect } from 'react';
 import Reveal from 'reveal.js';
 
 import type { PresentationOptions } from '../consts';
+import { parseSlideFrontmatterInMarkdown } from '../services/parse-slide-frontmatter';
 
 import { Slides } from './Slides';
 
@@ -33,14 +34,17 @@ const removeAllHiddenElements = () => {
 
 export type PresentationProps = {
   options: PresentationOptions,
-  hasMarpFlag: boolean,
+  isEnabledMarp: boolean,
   children?: string,
 }
 
 export const Presentation = (props: PresentationProps): JSX.Element => {
-  const { options, hasMarpFlag, children } = props;
+  const { options, isEnabledMarp, children } = props;
   const { revealOptions } = options;
 
+  const [marp] = parseSlideFrontmatterInMarkdown(children);
+  const hasMarpFlag = isEnabledMarp && marp;
+
   useEffect(() => {
     if (children == null) {
       return;