|
|
@@ -14,7 +14,7 @@ import deepmerge from 'ts-deepmerge';
|
|
|
import type { Pluggable, PluginTuple } from 'unified';
|
|
|
|
|
|
|
|
|
-import { CodeBlock } from '~/components/ReactMarkdownComponents/CodeBlock';
|
|
|
+import { InlineCodeBlock, CodeBlock } from '~/components/ReactMarkdownComponents/CodeBlock';
|
|
|
import { NextLink } from '~/components/ReactMarkdownComponents/NextLink';
|
|
|
import type { RendererOptions } from '~/interfaces/renderer-options';
|
|
|
import { RehypeSanitizeType } from '~/interfaces/services/rehype-sanitize';
|
|
|
@@ -111,6 +111,7 @@ export const generateCommonOptions = (pagePath: string|undefined): RendererOptio
|
|
|
],
|
|
|
components: {
|
|
|
a: NextLink,
|
|
|
+ inlinecode: InlineCodeBlock,
|
|
|
code: CodeBlock,
|
|
|
},
|
|
|
};
|
|
|
@@ -137,7 +138,7 @@ export const generateSSRViewOptions = (
|
|
|
remarkPlugins.push(breaks);
|
|
|
}
|
|
|
|
|
|
- const rehypeSanitizePlugin: Pluggable<any[]> | (() => void) = config.isEnabledXssPrevention
|
|
|
+ const rehypeSanitizePlugin: Pluggable | (() => void) = config.isEnabledXssPrevention
|
|
|
? [sanitize, deepmerge(
|
|
|
getCommonSanitizeOption(config),
|
|
|
)]
|