[opt] Optimize the display of exported chat history content.

This commit is contained in:
ガオガオ
2023-04-04 05:37:35 +08:00
parent 7d7f3716be
commit be4144fab3
6 changed files with 13 additions and 1 deletions

View File

@@ -60,7 +60,9 @@ function exportMessages(messages: Message[], topic: string) {
`# ${topic}\n\n` +
messages
.map((m) => {
return m.role === "user" ? `## ${m.content}` : m.content.trim();
return m.role === "user"
? `## ${Locale.Export.MessageFromYou}:\n${m.content}`
: `## ${Locale.Export.MessageFromChatGPT}:\n${m.content.trim()}`;
})
.join("\n\n");
const filename = `${topic}.md`;