Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/components/codeBlock/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ export function CodeBlock({filename, language, children}: CodeBlockProps) {

useCleanSnippetInClipboard(codeRef, {language});

// Mermaid blocks should not be processed by CodeBlock - they need special client-side rendering
if (language === 'mermaid') {
return <div className="language-mermaid">{children}</div>;
}

async function copyCodeOnClick() {
if (codeRef.current === null) {
return;
Expand Down
4 changes: 4 additions & 0 deletions src/rehype-onboarding-lines.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ function visitor(node) {
if (!node.properties.className?.includes('code-highlight')) {
return;
}
// ignore mermaid code blocks - they have special client-side rendering
if (node.properties.className?.includes('language-mermaid')) {
return;
}
handle_inline_options(node);
}

Expand Down
Loading