add support for rendering markdown #14
Merged
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.
What does this PR do?
This pull request enhances the rendering of chat history in the UI by adding support for Markdown formatting and improves code modularity. The most important changes include introducing a new
MarkdownRenderercomponent, updating theChatHistorycomponent to use it, and adding a new dependency for Markdown rendering.Markdown rendering enhancements:
MarkdownRenderercomponent: Added a utility component insrc/ui/utils/markdown-renderer.tsxto render Markdown content using theink-markdownlibrary. ([src/ui/utils/markdown-renderer.tsxR1-R6](https://github.com/superagent-ai/grok-cli/pull/14/files#diff-005ce32cfd4f531d35e14136e30ad697a9ccab02e95dc4f2a429d812c4cebe42R1-R6))ChatHistory: Updated theChatHistorycomponent insrc/ui/components/chat-history.tsxto use theMarkdownRendererfor rendering chat messages as Markdown if no tool calls are present. ([src/ui/components/chat-history.tsxL62-R76](https://github.com/superagent-ai/grok-cli/pull/14/files#diff-82d2091fe49b119bba0c22185835018b6456bf9c35099c7f30f5ce2abd9b5e86L62-R76))Dependency updates:
ink-markdown: Introduced theink-markdownlibrary as a new dependency inpackage.jsonto enable Markdown rendering in the terminal. ([package.jsonR34](https://github.com/superagent-ai/grok-cli/pull/14/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R34))Fixes #13
Checklist