Skip to content

Commit

Permalink
javascript engineを利用する
Browse files Browse the repository at this point in the history
  • Loading branch information
k35o committed Sep 4, 2024
1 parent 35c6ae5 commit bf8ab11
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import BundleAnalyzer from '@next/bundle-analyzer';
import rehypePrettyCode from "rehype-pretty-code";
import rehypeKatex from "rehype-katex";
import remarkMath from "remark-math";
import { createHighlighter } from "shiki";
import { createHighlighter, createJavaScriptRegexEngine } from "shiki";

/** @type {import('next').NextConfig} */
const nextConfig = {
Expand Down Expand Up @@ -31,7 +31,12 @@ export default withBundleAnalyzer(
/** @type {Partial<import("rehype-pretty-code").Options>} */
({
theme: "one-dark-pro",
createHighlighter,
createHighlighter: (options) => {
createHighlighter({
...options,
engine: createJavaScriptRegexEngine(),
})
},
}),
],
],
Expand Down

0 comments on commit bf8ab11

Please sign in to comment.