Skip to content

Remend partial markdown can sometimes have FOUM #539

Description

@Harpush

Bug Description

When streaming, markdown can arrive in chunks remend can't be sure how to complete. Currently there is no way to handle that and the result is small flashes of un-styled markdown.
Two examples:

  1. my name is ** - will return literal ** but the next char that will arrive will make it bold thus a flashing **.
  2. - item\n - will return the same text and a - will be shown until the next character that will make it a list

I think there should be a way to identify those cases (optional?) and maybe even buffer until the parser can be sure if incomplete or not.
There are also tougher cases like tables (might need to wait longer to be sure if a table or not). Maybe provide built in handlers for those cases?

Steps to Reproduce

Call remend with the above text

Expected Behavior

Either buffer (drop the incomplete text until sure) or at least inform somehow there is ambiguous incomplete markdown.
Can be another option or some other way.

Actual Behavior

Completes only when 100% sure but does nothing when ambiguous

Code Sample

Streamdown Version

remend 1.3.0

React Version


Node.js Version

22.22.3

Browser(s)

Chrome

Operating System

Windows

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions