|
|
@@ -14,7 +14,7 @@ import deepmerge from 'ts-deepmerge';
|
|
|
import type { Pluggable, PluginTuple } from 'unified';
|
|
|
|
|
|
|
|
|
-import { InlineCodeBlock, CodeBlock } from '~/components/ReactMarkdownComponents/CodeBlock';
|
|
|
+import { 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';
|
|
|
@@ -25,6 +25,7 @@ import { tagNames as recommendedTagNames, attributes as recommendedAttributes }
|
|
|
import * as addClass from './rehype-plugins/add-class';
|
|
|
import { relativeLinks } from './rehype-plugins/relative-links';
|
|
|
import { relativeLinksByPukiwikiLikeLinker } from './rehype-plugins/relative-links-by-pukiwiki-like-linker';
|
|
|
+import * as codeBlocks from './remark-plugins/codeblock';
|
|
|
import { pukiwikiLikeLinker } from './remark-plugins/pukiwiki-like-linker';
|
|
|
import * as xsvToTable from './remark-plugins/xsv-to-table';
|
|
|
|
|
|
@@ -96,6 +97,7 @@ export const generateCommonOptions = (pagePath: string|undefined): RendererOptio
|
|
|
pukiwikiLikeLinker,
|
|
|
growiDirective,
|
|
|
remarkFrontmatter,
|
|
|
+ codeBlocks.remarkPlugin,
|
|
|
],
|
|
|
remarkRehypeOptions: {
|
|
|
clobberPrefix: '', // remove clobber prefix
|
|
|
@@ -108,10 +110,10 @@ export const generateCommonOptions = (pagePath: string|undefined): RendererOptio
|
|
|
[addClass.rehypePlugin, {
|
|
|
table: 'table table-bordered',
|
|
|
}],
|
|
|
+ codeBlocks.rehypePlugin,
|
|
|
],
|
|
|
components: {
|
|
|
a: NextLink,
|
|
|
- inlinecode: InlineCodeBlock,
|
|
|
code: CodeBlock,
|
|
|
},
|
|
|
};
|