|
|
@@ -58,6 +58,7 @@ import { DialogTimeline } from "./dialog-timeline"
|
|
|
import { DialogForkFromTimeline } from "./dialog-fork-from-timeline"
|
|
|
import { DialogSessionRename } from "../../component/dialog-session-rename"
|
|
|
import { Sidebar } from "./sidebar"
|
|
|
+import { Flag } from "@/flag/flag"
|
|
|
import { LANGUAGE_EXTENSIONS } from "@/lsp/language"
|
|
|
import parsers from "../../../../../../parsers-config.ts"
|
|
|
import { Clipboard } from "../../util/clipboard"
|
|
|
@@ -1338,15 +1339,26 @@ function TextPart(props: { last: boolean; part: TextPart; message: AssistantMess
|
|
|
return (
|
|
|
<Show when={props.part.text.trim()}>
|
|
|
<box id={"text-" + props.part.id} paddingLeft={3} marginTop={1} flexShrink={0}>
|
|
|
- <code
|
|
|
- filetype="markdown"
|
|
|
- drawUnstyledText={false}
|
|
|
- streaming={true}
|
|
|
- syntaxStyle={syntax()}
|
|
|
- content={props.part.text.trim()}
|
|
|
- conceal={ctx.conceal()}
|
|
|
- fg={theme.text}
|
|
|
- />
|
|
|
+ <Switch>
|
|
|
+ <Match when={Flag.OPENCODE_EXPERIMENTAL_MARKDOWN}>
|
|
|
+ <markdown
|
|
|
+ syntaxStyle={syntax()}
|
|
|
+ content={props.part.text.trim()}
|
|
|
+ conceal={ctx.conceal()}
|
|
|
+ />
|
|
|
+ </Match>
|
|
|
+ <Match when={!Flag.OPENCODE_EXPERIMENTAL_MARKDOWN}>
|
|
|
+ <code
|
|
|
+ filetype="markdown"
|
|
|
+ drawUnstyledText={false}
|
|
|
+ streaming={true}
|
|
|
+ syntaxStyle={syntax()}
|
|
|
+ content={props.part.text.trim()}
|
|
|
+ conceal={ctx.conceal()}
|
|
|
+ fg={theme.text}
|
|
|
+ />
|
|
|
+ </Match>
|
|
|
+ </Switch>
|
|
|
</box>
|
|
|
</Show>
|
|
|
)
|