|
@@ -2,6 +2,7 @@ import React, {
|
|
|
useCallback, useEffect, useMemo, useState,
|
|
useCallback, useEffect, useMemo, useState,
|
|
|
} from 'react';
|
|
} from 'react';
|
|
|
|
|
|
|
|
|
|
+import AppContainer from '~/client/services/AppContainer';
|
|
|
import { blinkElem } from '~/client/util/blink-section-header';
|
|
import { blinkElem } from '~/client/util/blink-section-header';
|
|
|
import { addSmoothScrollEvent } from '~/client/util/smooth-scroll';
|
|
import { addSmoothScrollEvent } from '~/client/util/smooth-scroll';
|
|
|
import { CustomWindow } from '~/interfaces/global';
|
|
import { CustomWindow } from '~/interfaces/global';
|
|
@@ -9,6 +10,8 @@ import GrowiRenderer from '~/services/renderer/growi-renderer';
|
|
|
import { useEditorSettings } from '~/stores/editor';
|
|
import { useEditorSettings } from '~/stores/editor';
|
|
|
import loggerFactory from '~/utils/logger';
|
|
import loggerFactory from '~/utils/logger';
|
|
|
|
|
|
|
|
|
|
+import { withUnstatedContainers } from '../UnstatedUtils';
|
|
|
|
|
+
|
|
|
import RevisionBody from './RevisionBody';
|
|
import RevisionBody from './RevisionBody';
|
|
|
|
|
|
|
|
|
|
|
|
@@ -84,6 +87,7 @@ function getHighlightedBody(body: string, _keywords: string | string[]): string
|
|
|
|
|
|
|
|
|
|
|
|
|
type Props = {
|
|
type Props = {
|
|
|
|
|
+ appContainer: AppContainer,
|
|
|
growiRenderer: GrowiRenderer,
|
|
growiRenderer: GrowiRenderer,
|
|
|
markdown: string,
|
|
markdown: string,
|
|
|
pagePath: string,
|
|
pagePath: string,
|
|
@@ -154,9 +158,13 @@ const RevisionRenderer = (props: Props): JSX.Element => {
|
|
|
|
|
|
|
|
}, [currentRenderingContext, interceptorManager, renderHtml]);
|
|
}, [currentRenderingContext, interceptorManager, renderHtml]);
|
|
|
|
|
|
|
|
|
|
+ const config = props.appContainer.getConfig();
|
|
|
|
|
+ const isMathJaxEnabled = !!config.env.MATHJAX;
|
|
|
|
|
+
|
|
|
return (
|
|
return (
|
|
|
<RevisionBody
|
|
<RevisionBody
|
|
|
html={html}
|
|
html={html}
|
|
|
|
|
+ isMathJaxEnabled={isMathJaxEnabled}
|
|
|
additionalClassName={props.additionalClassName}
|
|
additionalClassName={props.additionalClassName}
|
|
|
renderMathJaxOnInit
|
|
renderMathJaxOnInit
|
|
|
/>
|
|
/>
|
|
@@ -164,4 +172,9 @@ const RevisionRenderer = (props: Props): JSX.Element => {
|
|
|
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-export default RevisionRenderer;
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * Wrapper component for using unstated
|
|
|
|
|
+ */
|
|
|
|
|
+const RevisionRendererWrapper = withUnstatedContainers(RevisionRenderer, [AppContainer]);
|
|
|
|
|
+
|
|
|
|
|
+export default RevisionRendererWrapper;
|