Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X进行数据处理的时候,只要遇到的数据来源包含换行符就报错The key-value separator ":" is not found in the sse line chunk! #474

Open
lblinmi opened this issue Jan 14, 2025 · 5 comments

Comments

@lblinmi
Copy link

lblinmi commented Jan 14, 2025

例如下面这个数据,就无法进行处理。

Image

event: message
data: {"id":"0","content":"He
"}

@YumoImer
Copy link
Collaborator

默认情况 XStream 会按 SSE 对数据解析,你截图的这个数据不是规范的 SSE 数据~

符合预期的 SSE 数据为:

event: message
data: {"id":"0","content":"He"}

所以这里抛错也是符合预期的。

@YumoImer
Copy link
Collaborator

似乎和这个 issue 类似:

#447

@lblinmi
Copy link
Author

lblinmi commented Jan 14, 2025

默认情况 XStream 会按 SSE 对数据解析,你截图的这个数据不是规范的 SSE 数据~

符合预期的 SSE 数据为:

event: message
data: {"id":"0","content":"He"}

所以这里抛错也是符合预期的。

但是,这个框架在输出内容的时候如何实现换行输出呢?没找到对应的例子,求教

@lblinmi
Copy link
Author

lblinmi commented Jan 14, 2025

似乎和这个 issue 类似:

#447

Image

你好,官网的这种不同背景底色和换行是怎么实现的啊

@YumoImer
Copy link
Collaborator

默认情况 XStream 会按 SSE 对数据解析,你截图的这个数据不是规范的 SSE 数据~
符合预期的 SSE 数据为:

event: message
data: {"id":"0","content":"He"}

所以这里抛错也是符合预期的。

但是,这个框架在输出内容的时候如何实现换行输出呢?没找到对应的例子,求教

可以将 content 使用 markdown 渲染实现换行输出~

https://x.ant.design/components/bubble-cn#bubble-demo-markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants