Skip to content

Commit

Permalink
fix code block title
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed Apr 15, 2021
1 parent 87102f6 commit f23e823
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,13 @@ export default function CodeBlock({
setMounted(true);
}, []);

// TODO: the title is provided by MDX as props automatically
// so we probably don't need to parse the metastring
// (note: title="xyz" => title prop still has the quotes)
const codeBlockTitle = parseCodeBlockTitle(metastring) || title;

const button = useRef(null);
let highlightLines: number[] = [];
const codeBlockTitle = title ?? parseCodeBlockTitle(metastring);

const prismTheme = usePrismTheme();

Expand Down

0 comments on commit f23e823

Please sign in to comment.