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

+ 0 - 12
apps/app/src/features/frontmatter-hider/components/FrontmatterHideViewer.tsx

@@ -1,12 +0,0 @@
-import React, { ReactNode } from 'react';
-
-
-type FrontmatterHideViewerProps = {
-  children: ReactNode,
-}
-
-export const FrontmatterHideViewer = React.memo((props: FrontmatterHideViewerProps): JSX.Element => {
-  const { children } = props;
-  return <></>;
-});
-FrontmatterHideViewer.displayName = 'FronttmatterHideViewer';

+ 0 - 1
apps/app/src/features/frontmatter-hider/components/index.ts

@@ -1 +0,0 @@
-export { FrontmatterHideViewer } from './FrontmatterHideViewer';

+ 0 - 1
apps/app/src/features/frontmatter-hider/index.ts

@@ -1,2 +1 @@
-export * from './components';
 export * from './services';

+ 7 - 1
apps/app/src/features/frontmatter-hider/services/frontmatter-hider.ts

@@ -21,7 +21,13 @@ export const remarkPlugin: Plugin = function() {
 };
 
 export const rehypePlugin: Plugin = function() {
-  return;
+  return (tree) => {
+    visit(tree, (node) => {
+      if (node.type === 'yaml') {
+        return;
+      }
+    });
+  };
 };
 
 export const sanitizeOption: SanitizeOption = {

+ 2 - 2
apps/app/src/services/renderer/renderer.tsx

@@ -101,7 +101,7 @@ export const generateCommonOptions = (pagePath: string|undefined): RendererOptio
       pukiwikiLikeLinker,
       growiDirective,
       remarkFrontmatter,
-      frontmatterHider.remarkPlugin,
+      // frontmatterHider.remarkPlugin,
     ],
     remarkRehypeOptions: {
       clobberPrefix: '', // remove clobber prefix
@@ -114,7 +114,7 @@ export const generateCommonOptions = (pagePath: string|undefined): RendererOptio
       [addClass.rehypePlugin, {
         table: 'table table-bordered',
       }],
-      frontmatterHider.rehypePlugin,
+      // frontmatterHider.rehypePlugin,
     ],
     components: {
       a: NextLink,