diff --git a/src/app/components/Share/MarkdownView.tsx b/src/app/components/Share/MarkdownView.tsx index b2f82667..31c2ed29 100644 --- a/src/app/components/Share/MarkdownView.tsx +++ b/src/app/components/Share/MarkdownView.tsx @@ -13,10 +13,18 @@ const MarkdownView: FC = ({ messages }) => { const content = useMemo(() => { return messages .filter((m) => !!m.text) - .map((m) => `**${m.author}**: ` + m.text) - .join('\n\n') - }, [messages]) - + .map((m) => { + // Check if author is "user" + if (m.author === "user") { + // Format as an h2 markdown element + return `## ${m.author}: ${m.text}`; + } else { + return `**${m.author}**: ${m.text}`; + } + }) + .join('\n\n'); + }, [messages]); + const copy = useCallback(() => { navigator.clipboard.writeText(content) setCopied(true)