From 8206da4d9ef5871ebf1cf56f9231eba5b7036fc3 Mon Sep 17 00:00:00 2001
From: Jay V <air@live.ca>
Date: Tue, 3 Jun 2025 17:20:24 -0400
Subject: share page bugs

---
 packages/web/src/components/CodeBlock.tsx | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'packages/web/src/components/CodeBlock.tsx')

diff --git a/packages/web/src/components/CodeBlock.tsx b/packages/web/src/components/CodeBlock.tsx
index b3a0d3f2e..a9bfae8be 100644
--- a/packages/web/src/components/CodeBlock.tsx
+++ b/packages/web/src/components/CodeBlock.tsx
@@ -12,9 +12,10 @@ import { transformerNotationDiff } from "@shikijs/transformers"
 interface CodeBlockProps extends JSX.HTMLAttributes<HTMLDivElement> {
   code: string
   lang?: string
+  onRendered?: () => void
 }
 function CodeBlock(props: CodeBlockProps) {
-  const [local, rest] = splitProps(props, ["code", "lang"])
+  const [local, rest] = splitProps(props, ["code", "lang", "onRendered"])
   let containerRef!: HTMLDivElement
 
   const [html] = createResource(async () => {
@@ -35,6 +36,8 @@ function CodeBlock(props: CodeBlockProps) {
   createEffect(() => {
     if (html() && containerRef) {
       containerRef.innerHTML = html() as string
+
+      local.onRendered?.()
     }
   })
 
-- 
cgit v1.2.3

