diff options
| author | Dax <[email protected]> | 2025-07-07 15:53:43 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-07 15:53:43 -0400 |
| commit | f884766445bbf1fbce11f1db4bc6174e72d9baa5 (patch) | |
| tree | e7d9e7b3d8efc8bed249f9d29e2d8fb838a275f2 /packages/web/src/components/MarkdownView.tsx | |
| parent | 76b2e4539cb97bae5812ed2d832ce49d02e70c64 (diff) | |
| download | opencode-f884766445bbf1fbce11f1db4bc6174e72d9baa5.tar.gz opencode-f884766445bbf1fbce11f1db4bc6174e72d9baa5.zip | |
v2 message format and upgrade to ai sdk v5 (#743)
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Liang-Shih Lin <[email protected]>
Co-authored-by: Dominik Engelhardt <[email protected]>
Co-authored-by: Jay V <[email protected]>
Co-authored-by: adamdottv <[email protected]>
Diffstat (limited to 'packages/web/src/components/MarkdownView.tsx')
| -rw-r--r-- | packages/web/src/components/MarkdownView.tsx | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/packages/web/src/components/MarkdownView.tsx b/packages/web/src/components/MarkdownView.tsx deleted file mode 100644 index 7a63bc0cb..000000000 --- a/packages/web/src/components/MarkdownView.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import { type JSX, splitProps, createResource } from "solid-js" -import { marked } from "marked" -import markedShiki from "marked-shiki" -import { codeToHtml } from "shiki" -import { transformerNotationDiff } from "@shikijs/transformers" -import styles from "./markdownview.module.css" - -interface MarkdownViewProps extends JSX.HTMLAttributes<HTMLDivElement> { - markdown: string -} - -const markedWithShiki = marked.use( - markedShiki({ - highlight(code, lang) { - return codeToHtml(code, { - lang: lang || "text", - themes: { - light: "github-light", - dark: "github-dark", - }, - transformers: [transformerNotationDiff()], - }) - }, - }), -) - -function MarkdownView(props: MarkdownViewProps) { - const [local, rest] = splitProps(props, ["markdown"]) - const [html] = createResource( - () => local.markdown, - async (markdown) => { - return markedWithShiki.parse(markdown) - }, - ) - - return <div innerHTML={html()} class={styles["markdown-body"]} {...rest} /> -} - -export default MarkdownView |
