Shiki settings preview (#297)
This commit is contained in:
@ -42,6 +42,7 @@ export interface HighlighterProps {
|
||||
lang?: string;
|
||||
content: string;
|
||||
isPreview: boolean;
|
||||
tempSettings?: Record<string, any>;
|
||||
}
|
||||
|
||||
export const createHighlighter = (props: HighlighterProps) => (
|
||||
@ -53,8 +54,13 @@ export const Highlighter = ({
|
||||
lang,
|
||||
content,
|
||||
isPreview,
|
||||
tempSettings,
|
||||
}: HighlighterProps) => {
|
||||
const { tryHljs, useDevIcon, bgOpacity } = useShikiSettings(["tryHljs", "useDevIcon", "bgOpacity"]);
|
||||
const {
|
||||
tryHljs,
|
||||
useDevIcon,
|
||||
bgOpacity,
|
||||
} = useShikiSettings(["tryHljs", "useDevIcon", "bgOpacity"], tempSettings);
|
||||
const { id: currentThemeId, theme: currentTheme } = useTheme();
|
||||
|
||||
const shikiLang = lang ? resolveLang(lang) : null;
|
||||
|
Reference in New Issue
Block a user