In the streaming text scenario of large language models, a large amount of text will be appended to the Markdown text within a short period.
Since incremental parsing is not supported, every time a single character is appended, a full-scale parsing is required. Moreover, due to full-scale parsing, the ASTNode will be a new instance.
In the rendering scenario of Compose, all nodes need to be re-rendered, which leads to poor performance and lag. It is expected to add incremental parsing so that when the text changes, the nodes can remain unchanged, thereby improving rendering performance. Although the implementation plan for triggering incremental rendering with incremental parsing still needs to be considered.
I referred to this project for the rendering of Markdown in Compose. multiplatform-markdown-renderer
In the streaming text scenario of large language models, a large amount of text will be appended to the Markdown text within a short period.
Since incremental parsing is not supported, every time a single character is appended, a full-scale parsing is required. Moreover, due to full-scale parsing, the ASTNode will be a new instance.
In the rendering scenario of Compose, all nodes need to be re-rendered, which leads to poor performance and lag. It is expected to add incremental parsing so that when the text changes, the nodes can remain unchanged, thereby improving rendering performance. Although the implementation plan for triggering incremental rendering with incremental parsing still needs to be considered.
I referred to this project for the rendering of Markdown in Compose. multiplatform-markdown-renderer