-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Incremental markdown
parsing and various fixes
#2776
Merged
Merged
+548
−169
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Specially useful when dealing with long Markdown streams, like LLMs.
This improves layout diffing considerably!
hecrj
added
bug
Something isn't working
improvement
An internal improvement
feature
New feature or request
performance
widget
change
addition
fix
labels
Feb 1, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
addition
bug
Something isn't working
change
feature
New feature or request
fix
improvement
An internal improvement
performance
widget
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a new
Content
type in themarkdown
module that allows users to incrementally parse Markdown—using itspush_str
method.This is specially useful when you have potentially long Markdown streams—like an LLM reply in an AI chat application.
In fact,
icebreaker
has been the main driver of this feature (see hecrj/icebreaker#7):2025-02-01.01-09-57.mp4
These changes also fix a bunch of minor issues and improve some APIs:
spacing
of Markdown items can be configured throughmarkdown::Settings
.container::Id
orscrollable::Id
now usesInto
generics. These types also implementFrom<&'static str>
now.text_editor
no longer captures unfocus events.stack
now propagates mouse movements unconditionally to all layers. This allows widgets that are being interacted with to still work even when the mouse hovers layers on top.rich_text
now requests redraws properly when a link is hovered.Shift
pressed.And I think that's about it!