Skip to content

App crashes while streaming data & converting to markdown #602

@ItzCrazyKns

Description

@ItzCrazyKns

When we stream data (in my case from a chatbot) to the frontend and then parse the markdown using markdown-to-jsx if the chatbot starts outputting a code block the app would crash (only for HTML). This happens as:

Since we stream the responses from chatbot the chatbot starts the code with opening the code block and then starts writing its HTML but since the code block isn't closed markdown-to-jsx detects it as plain HTML and renders it inside a <p> tag which causes DOM errors as the <html> tag cannot be a child of the <p> tag.

I believe markdown-to-jsx should detect the starting of the code block and till the code block is not closed by '```' it should just detect the chars after the starting as the code.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions