JetBrains / markdown

Markdown parser written in kotlin
Apache License 2.0
682 stars 75 forks source link

support incremental parsing with streams #139

Open Zane-XY opened 9 months ago

Zane-XY commented 9 months ago

It's now common to parse Markdown text streams from LLMs, and these inputs are in token streams. However, when a client needs to incrementally render these tokens as they receive them, they must accumulate the prefix and parse them as a whole repeatedly. This process can be very inefficient. It would be beneficial if the parser could support input streams and incrementally parse tokens and trigger the event listeners for the node creation.