Skip to content

Commit

Permalink
[@mantine/code-highlight] Fix CodeHighlightTabs throwing error if lan…
Browse files Browse the repository at this point in the history
…guage of the tab is nor specified (#5178)
  • Loading branch information
rtivital committed Nov 7, 2023
1 parent 80799a3 commit 29ffec6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mantine-code-highlight/src/CodeHighlightTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export const CodeHighlightTabs = factory<CodeHighlightTabsFactory>((_props, ref)
const currentCode = nodes[value];

const highlighted = hljs.highlight(currentCode.code.trim(), {
language: currentCode.language!,
language: currentCode.language || 'plaintext',
}).value;

const files = nodes.map((node, index) => (
Expand Down

0 comments on commit 29ffec6

Please sign in to comment.