ソースを参照

remove unused code

yuken 3 年 前
コミット
1f1aad6b5b

+ 8 - 23
packages/app/src/components/TableOfContents.tsx

@@ -69,29 +69,14 @@ const TableOfContents = (): JSX.Element => {
       stickyElemSelector=".grw-side-contents-sticky-container"
       calcViewHeight={calcViewHeight}
     >
-      <ReactMarkdown {...rendererOptions}>
-        {''}
-      </ReactMarkdown>
-      {/* { tocHtml !== ''
-        ? (
-          // <div
-          //   id="revision-toc-content"
-          //   className="revision-toc-content mb-3"
-          //   // eslint-disable-next-line react/no-danger
-          //   dangerouslySetInnerHTML={{ __html: tocHtml }}
-          // />
-          <ReactMarkdown {...rendererOptions}>
-            {''}
-          </ReactMarkdown>
-        )
-        : (
-          <div
-            id="revision-toc-content"
-            className="revision-toc-content mb-2"
-          >
-          </div>
-        ) } */}
-
+      <div
+        id="revision-toc-content"
+        className="revision-toc-content mb-3"
+      >
+        <ReactMarkdown {...rendererOptions}>
+          {''}
+        </ReactMarkdown>
+      </div>
     </StickyStretchableScroller>
   );
 

+ 0 - 2
packages/app/src/interfaces/services/renderer.ts

@@ -1,5 +1,3 @@
-import { HtmlElementNode } from 'rehype-toc';
-
 import { XssOptionConfig } from '~/services/xss/xssOption';
 
 // export type GrowiHydratedEnv = {

+ 1 - 0
packages/app/src/pages/[[...path]].page.tsx

@@ -186,6 +186,7 @@ const GrowiPage: NextPage<Props> = (props: Props) => {
   // useNoCdn(props.noCdn);
   // useIndentSize(props.adminPreferredIndentSize);
   useDisableLinkSharing(props.disableLinkSharing);
+
   useRendererConfig(props.rendererConfig);
   // useRendererSettings(props.rendererSettingsStr != null ? JSON.parse(props.rendererSettingsStr) : undefined);
   // useGrowiRendererConfig(props.growiRendererConfigStr != null ? JSON.parse(props.growiRendererConfigStr) : undefined);

+ 1 - 8
packages/app/src/services/renderer/renderer.tsx

@@ -1,6 +1,5 @@
 import { ReactMarkdownOptions } from 'react-markdown/lib/react-markdown';
 import slug from 'rehype-slug';
-import toc from 'rehype-toc';
 import breaks from 'remark-breaks';
 import emoji from 'remark-emoji';
 import footnotes from 'remark-footnotes';
@@ -244,12 +243,6 @@ export const generateViewOptions: ReactMarkdownOptionsGenerator = (config: Rende
     // use rehype-toc and get toc node
     customizer(options);
   }
-  // if (rehypePlugins != null) {
-  //   rehypePlugins.push([toc, {
-  //     headings: ['h1', 'h2', 'h3'],
-  //     customizeTOC: config.storeTocNode,
-  //   }]);
-  // }
   // rehypePlugins.push([toc, {
   //   headings: ['h1', 'h2', 'h3'],
   //   customizeTOC: storeTocNode,
@@ -284,7 +277,7 @@ export const generateTocOptions: ReactMarkdownOptionsGenerator = (config: Render
 
   const options = generateCommonOptions(config);
 
-  const { remarkPlugins, rehypePlugins, components } = options;
+  const { remarkPlugins } = options;
 
   // add remark plugins
   if (remarkPlugins != null) {