showdownjs / showdown

A bidirectional Markdown to HTML to Markdown converter written in Javascript
http://www.showdownjs.com/
MIT License
14.32k stars 1.57k forks source link

More complete preview of partial markdown #1010

Open andersborgabiro opened 6 months ago

andersborgabiro commented 6 months ago

For you to consider:

Regarding the behavior of smoothLivePreview:

When a code block is started using 3 back apostrophs showdown doesn't consider it a code block until explicitly terminated.

Could it be the default or a separate setting to also support incomplete blocks (whether code or something else). This would make e.g. responses from an LLM look much less "jumpy" (and less wrong) when streaming, where partial data is a given.

If you provide a pointer to where this would be handled I can take a look myself.

I thought this was similar, but it's not: https://github.com/showdownjs/showdown/issues/1000

Conversion to HTML otherwise works quite well, also for partial streamed data.