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

markdown from openAi streamed data gives weird results #1000

Open
itscvenk opened this issue Feb 24, 2024 · 0 comments
Open

markdown from openAi streamed data gives weird results #1000

itscvenk opened this issue Feb 24, 2024 · 0 comments

Comments

@itscvenk
Copy link

itscvenk commented Feb 24, 2024

When I use with OpenAi API streamed data, i get weird results

`
const div = document.getElementById(uuid);
let converter = new showdown.Converter({smoothLivePreview: true});
let parsedHtml = converter.makeHtml(txt);

`

The result is something like this when i add it to a div using innerHtml (see image please)

All the chunks go into a new line and the markdown isn't parsed :-(

image

EDITED

showdownjs parses the text and adds a "html p" tag to every streamed word in every text :-(

And the markdown isn't applied either . I used the code from https://github.com/orhanerday/ChatGPT and just referenced latest version of showdownjs and added the above code for the parsing

Also tried without the smoothLivePreview . No luck :-(

Please help

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

1 participant