🎉 initiate project *astro_rewrite*
This commit is contained in:
parent
ffd4d5e86c
commit
2ba37bfbe3
8658 changed files with 2268794 additions and 2538 deletions
28
node_modules/@astrojs/markdown-remark/dist/remark-prism.js
generated
vendored
Normal file
28
node_modules/@astrojs/markdown-remark/dist/remark-prism.js
generated
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import { runHighlighterWithAstro } from "@astrojs/prism/dist/highlighter";
|
||||
import { visit } from "unist-util-visit";
|
||||
const noVisit = /* @__PURE__ */ new Set(["root", "html", "text"]);
|
||||
function transformer(className) {
|
||||
return function(tree) {
|
||||
const visitor = (node) => {
|
||||
let { lang, value } = node;
|
||||
node.type = "html";
|
||||
let { html, classLanguage } = runHighlighterWithAstro(lang, value);
|
||||
let classes = [classLanguage];
|
||||
if (className) {
|
||||
classes.push(className);
|
||||
}
|
||||
node.value = `<pre class="${classes.join(
|
||||
" "
|
||||
)}"><code is:raw class="${classLanguage}">${html}</code></pre>`;
|
||||
return node;
|
||||
};
|
||||
return visit(tree, "code", visitor);
|
||||
};
|
||||
}
|
||||
function plugin(className) {
|
||||
return transformer.bind(null, className);
|
||||
}
|
||||
var remark_prism_default = plugin;
|
||||
export {
|
||||
remark_prism_default as default
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue