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

Function rehypeParseCodeBlocks

apps/baseai.dev/src/mdx/rehype.ts:10–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8import lang from './languages.mjs';
9
10export function rehypeParseCodeBlocks() {
11 return (tree: any) => {
12 visit(tree, 'element', (node, _nodeIndex, parentNode) => {
13 if (node.tagName === 'code' && node.properties.className) {
14 parentNode.properties.language =
15 node.properties.className[0]?.replace(/^language-/, '');
16 }
17 });
18 };
19}
20
21let highlighter: any;
22

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected