From 3fa280d21878ae391674a21758199df3d2d8c3b5 Mon Sep 17 00:00:00 2001
From: Adam <2363879+adamdotdevin@users.noreply.github.com>
Date: Fri, 3 Oct 2025 09:04:28 -0500
Subject: chore: app -> desktop

---
 packages/desktop/src/components/markdown.tsx | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 packages/desktop/src/components/markdown.tsx

(limited to 'packages/desktop/src/components/markdown.tsx')

diff --git a/packages/desktop/src/components/markdown.tsx b/packages/desktop/src/components/markdown.tsx
new file mode 100644
index 000000000..a60fad149
--- /dev/null
+++ b/packages/desktop/src/components/markdown.tsx
@@ -0,0 +1,23 @@
+import { useMarked } from "@/context"
+import { createResource } from "solid-js"
+
+function strip(text: string): string {
+  const wrappedRe = /^\s*<([A-Za-z]\w*)>\s*([\s\S]*?)\s*<\/\1>\s*$/
+  const match = text.match(wrappedRe)
+  return match ? match[2] : text
+}
+export function Markdown(props: { text: string; class?: string }) {
+  const marked = useMarked()
+  const [html] = createResource(
+    () => strip(props.text),
+    async (markdown) => {
+      return marked.parse(markdown)
+    },
+  )
+  return (
+    <div
+      class={`min-w-0 max-w-full text-xs overflow-auto no-scrollbar prose ${props.class ?? ""}`}
+      innerHTML={html()}
+    />
+  )
+}
-- 
cgit v1.2.3

