Skip to content

Commit

Permalink
fix: add codeTitle back to CodeBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-tucker committed Oct 26, 2023
1 parent 26cdb91 commit cc8f791
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/components/CodeBlock/CodeBlock.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import 'prismjs/plugins/normalize-whitespace/prism-normalize-whitespace';
export let code: string;
export let codeTitle: string | undefined = undefined;
export let lang: string;
const decodedCode = decodeURIComponent(code);
Expand All @@ -21,7 +22,7 @@
</script>

<div class="code" data-prismjs-copy-timeout="1000">
<div class="language-wrapper">{lang}</div>
<div class="language-wrapper">{codeTitle || lang}</div>
<pre class={`language-${formatLang} line-numbers copy-to-clipboard`}>
<code class={`language-${formatLang}`} data-prismjs-copy="Click to copy code!">
{decodedCode}
Expand Down

0 comments on commit cc8f791

Please sign in to comment.