@tanstack/highlight
Version:
Tiny class-based syntax highlighting for documentation.
19 lines (18 loc) • 561 B
JavaScript
import { rehypeHighlightCodeBlocks, } from './rehype.js';
export function createHighlightedCodeBlockProps({ className, code, decorations, highlighter, lang, lineNumbers, title, }) {
const rendered = highlighter.renderCodeBlockData({
code,
decorations,
lang,
lineNumbers,
title,
});
return {
...rendered,
className,
dangerouslySetInnerHTML: { __html: rendered.htmlMarkup },
};
}
export function createOctaneMdxHighlight(options) {
return [rehypeHighlightCodeBlocks, options];
}