mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-20 03:47:01 -04:00
Shiki settings preview (#297)
This commit is contained in:
parent
49b45d8262
commit
2d08dd8a9c
6 changed files with 48 additions and 6 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue