We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1e6359b commit 7168b6dCopy full SHA for 7168b6d
src/app/components/Share/MarkdownView.tsx
@@ -13,10 +13,18 @@ const MarkdownView: FC<Props> = ({ messages }) => {
13
const content = useMemo(() => {
14
return messages
15
.filter((m) => !!m.text)
16
- .map((m) => `**${m.author}**: ` + m.text)
17
- .join('\n\n')
18
- }, [messages])
19
-
+ .map((m) => {
+ // Check if author is "user"
+ if (m.author === "user") {
+ // Format as an h2 markdown element
20
+ return `## ${m.author}: ${m.text}`;
21
+ } else {
22
+ return `**${m.author}**: ${m.text}`;
23
+ }
24
+ })
25
+ .join('\n\n');
26
+ }, [messages]);
27
+
28
const copy = useCallback(() => {
29
navigator.clipboard.writeText(content)
30
setCopied(true)
0 commit comments