|
@@ -24,13 +24,13 @@ export const useViewOptions = (): SWRResponse<RendererOptions, Error> => {
|
|
|
}, [mutateCurrentPageTocNode]);
|
|
}, [mutateCurrentPageTocNode]);
|
|
|
|
|
|
|
|
const isAllDataValid = currentPagePath != null && rendererConfig != null;
|
|
const isAllDataValid = currentPagePath != null && rendererConfig != null;
|
|
|
|
|
+ const customGenerater = getGrowiFacade().markdownRenderer?.optionsGenerators?.customGenerateViewOptions;
|
|
|
|
|
|
|
|
return useSWR(
|
|
return useSWR(
|
|
|
isAllDataValid
|
|
isAllDataValid
|
|
|
- ? ['viewOptions', currentPagePath, rendererConfig]
|
|
|
|
|
|
|
+ ? ['viewOptions', currentPagePath, rendererConfig, customGenerater]
|
|
|
: null,
|
|
: null,
|
|
|
async([, currentPagePath, rendererConfig]) => {
|
|
async([, currentPagePath, rendererConfig]) => {
|
|
|
- const customGenerater = getGrowiFacade().markdownRenderer?.optionsGenerators?.customGenerateViewOptions;
|
|
|
|
|
if (customGenerater != null) {
|
|
if (customGenerater != null) {
|
|
|
return customGenerater(currentPagePath, rendererConfig, storeTocNodeHandler);
|
|
return customGenerater(currentPagePath, rendererConfig, storeTocNodeHandler);
|
|
|
}
|
|
}
|
|
@@ -74,13 +74,13 @@ export const usePreviewOptions = (): SWRResponse<RendererOptions, Error> => {
|
|
|
const { data: rendererConfig } = useRendererConfig();
|
|
const { data: rendererConfig } = useRendererConfig();
|
|
|
|
|
|
|
|
const isAllDataValid = currentPagePath != null && rendererConfig != null;
|
|
const isAllDataValid = currentPagePath != null && rendererConfig != null;
|
|
|
|
|
+ const customGenerater = getGrowiFacade().markdownRenderer?.optionsGenerators?.customGeneratePreviewOptions;
|
|
|
|
|
|
|
|
return useSWR(
|
|
return useSWR(
|
|
|
isAllDataValid
|
|
isAllDataValid
|
|
|
- ? ['previewOptions', rendererConfig, currentPagePath]
|
|
|
|
|
|
|
+ ? ['previewOptions', rendererConfig, currentPagePath, customGenerater]
|
|
|
: null,
|
|
: null,
|
|
|
async([, rendererConfig, pagePath]) => {
|
|
async([, rendererConfig, pagePath]) => {
|
|
|
- const customGenerater = getGrowiFacade().markdownRenderer?.optionsGenerators?.customGeneratePreviewOptions;
|
|
|
|
|
if (customGenerater != null) {
|
|
if (customGenerater != null) {
|
|
|
return customGenerater(rendererConfig, pagePath);
|
|
return customGenerater(rendererConfig, pagePath);
|
|
|
}
|
|
}
|