我正在使用Next.js
+创建一个博客MDX-Bundler
并尝试使用remark-disable-tokenizers
禁用“缩进代码块”。但我无法让它工作。我在这里找到了一个参考,它说我们可以remark-disable-tokenizers
用于此目的。
这是我xdmoptions
的参考:
import disableTokens from 'remark-disable-tokenizers';
xdmOptions(options) {
options.rehypePlugins = [
...(options.rehypePlugins ?? []),
rehypeSlug,
rehypeCodeTitles,
rehypePrism,
[disableTokens,
{
block: [
['indentedCode', 'indented code is not supported by MDX-Bundler']
]
}],
[
rehypeAutolinkHeadings,
{...}
]
];
return options;
},