Something went wrong. Try again.
Monorepo for Tangled tangled.org
Something went wrong. Try again.
1234567891011121314151617181920212223import { canUseWASM, getSharedHighlighter as getPierreHighlighter, registerCustomCSSVariableTheme, type HighlighterTypes} from "@pierre/diffs";
// separate from pierre so a markdown page with no code doesn't load the diff renderer
export const SYNTAX_THEME_NAME = "tangled";
registerCustomCSSVariableTheme(SYNTAX_THEME_NAME, { background: "#ffffff", foreground: "#4c4f69"});
// one highlighter type can be active per thread, so every caller asks for this one.// highlights needs wasm with simd; shiki's js engine covers browsers without itexport const SYNTAX_HIGHLIGHTER: HighlighterTypes = canUseWASM() ? "highlights" : "shiki-js";
export const getSharedHighlighter = (options: { themes: string[]; langs: string[] }) => getPierreHighlighter({ ...options, preferredHighlighter: SYNTAX_HIGHLIGHTER });