Просмотр исходного кода

Apply marpit css to slide preview

reiji-h 2 лет назад
Родитель
Сommit
a868c1b540

+ 4 - 2
packages/presentation/src/components/RichSlideSection.tsx

@@ -11,9 +11,11 @@ export const RichSlideSection = React.memo((props: RichSlideSectionProps): JSX.E
 
   return (
     <section className="shadow rounded m-2">
-      <svg viewBox="0 0 1280 720">
+      <svg data-marpit-svg="" viewBox="0 0 1280 720">
         <foreignObject width="1280" height="720">
-          {children}
+          <section>
+            {children}
+          </section>
         </foreignObject>
       </svg>
     </section>

+ 2 - 2
packages/presentation/src/components/Slides.tsx

@@ -67,10 +67,10 @@ export const Slides = (props: Props): JSX.Element => {
     },
   ]);
   if (rendererOptions.components != null) {
-    // rendererOptions.components.section = RichSlideSection;
+    rendererOptions.components.section = RichSlideSection;
   }
 
-  const { css } = marpSlide.render('', { htmlAsArray: true });
+  const { css } = marpSlide.render('');
   return (
     <>
       <Head>