MCPcopy Create free account
hub / github.com/CommandCodeAI/BaseAI / rehypeParseCodeBlocks

Function rehypeParseCodeBlocks

apps/baseai.dev/src/mdx/rehype.mjs:13–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11const theme = require('./themes/shades-of-purple.json');
12
13export function rehypeParseCodeBlocks() {
14 return tree => {
15 visit(tree, 'element', (node, _nodeIndex, parentNode) => {
16 if (node.tagName === 'code' && node.properties.className) {
17 parentNode.properties.language =
18 node.properties.className[0]?.replace(/^language-/, '');
19 }
20 });
21 };
22}
23
24let highlighter;
25

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected