full site update
This commit is contained in:
22
node_modules/@astrojs/markdown-remark/dist/rehype-shiki.js
generated
vendored
22
node_modules/@astrojs/markdown-remark/dist/rehype-shiki.js
generated
vendored
@@ -1,11 +1,27 @@
|
||||
import { highlightCodeBlocks } from "./highlight.js";
|
||||
import { createShikiHighlighter } from "./shiki.js";
|
||||
const rehypeShiki = (config) => {
|
||||
const rehypeShiki = (config, excludeLangs) => {
|
||||
let highlighterAsync;
|
||||
return async (tree) => {
|
||||
highlighterAsync ??= createShikiHighlighter(config);
|
||||
highlighterAsync ??= createShikiHighlighter({
|
||||
langs: config?.langs,
|
||||
theme: config?.theme,
|
||||
themes: config?.themes,
|
||||
langAlias: config?.langAlias
|
||||
});
|
||||
const highlighter = await highlighterAsync;
|
||||
await highlightCodeBlocks(tree, highlighter.highlight);
|
||||
await highlightCodeBlocks(
|
||||
tree,
|
||||
(code, language, options) => {
|
||||
return highlighter.codeToHast(code, language, {
|
||||
meta: options?.meta,
|
||||
wrap: config?.wrap,
|
||||
defaultColor: config?.defaultColor,
|
||||
transformers: config?.transformers
|
||||
});
|
||||
},
|
||||
excludeLangs
|
||||
);
|
||||
};
|
||||
};
|
||||
export {
|
||||
|
Reference in New Issue
Block a user