Skip to content

Commit

Permalink
chore: 显示原文时使用 .whitespace-pre-wrap (Chanzhaoyu#779)
Browse files Browse the repository at this point in the history
显示 ChatGPT 输出的原文时保留空格和换行
  • Loading branch information
yilozt committed Mar 22, 2023
1 parent 9c6a3d6 commit 9227893
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/views/chat/components/Message/Text.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ defineExpose({ textRef })
<div ref="textRef" class="leading-relaxed break-words">
<div v-if="!inversion">
<div v-if="!asRawText" class="markdown-body" v-html="text" />
<div v-else class="raw-text" v-text="text" />
<div v-else class="whitespace-pre-wrap" v-text="text" />
</div>
<div v-else class="whitespace-pre-wrap" v-text="text" />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/views/chat/components/Message/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
html.dark {

.message-reply {
.raw-text {
.whitespace-pre-wrap {
white-space: pre-wrap;
color: var(--n-text-color);
}
Expand Down

0 comments on commit 9227893

Please sign in to comment.