mirror of
https://github.com/gradio-app/gradio.git
synced 2025-02-23 11:39:17 +08:00
Fix chatbot newline issue (#3717)
* changes * changes * changes * changelog --------- Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
This commit is contained in:
parent
13682c7bbc
commit
759fb3b1f2
31
CHANGELOG.md
31
CHANGELOG.md
@ -29,6 +29,37 @@ No changes to highlight.
|
||||
|
||||
No changes to highlight.
|
||||
|
||||
# Version 3.24.1
|
||||
|
||||
## New Features:
|
||||
|
||||
No changes to highlight.
|
||||
|
||||
## Bug Fixes:
|
||||
|
||||
- Fixes Chatbot issue where new lines were being created every time a message was sent back and forth by [@aliabid94](https://github.com/aliabid94) in [PR 3717](https://github.com/gradio-app/gradio/pull/3717).
|
||||
|
||||
|
||||
## Documentation Changes:
|
||||
|
||||
No changes to highlight.
|
||||
|
||||
## Testing and Infrastructure Changes:
|
||||
|
||||
No changes to highlight.
|
||||
|
||||
## Breaking Changes:
|
||||
|
||||
No changes to highlight.
|
||||
|
||||
## Full Changelog:
|
||||
|
||||
No changes to highlight.
|
||||
|
||||
## Contributors Shoutout:
|
||||
|
||||
No changes to highlight.
|
||||
|
||||
|
||||
|
||||
# Version 3.24.0
|
||||
|
@ -4302,6 +4302,7 @@ class Chatbot(Changeable, Selectable, IOComponent, JSONSerializable):
|
||||
"is_file": True,
|
||||
}
|
||||
elif isinstance(chat_message, str):
|
||||
chat_message = chat_message.replace("\n", "<br>")
|
||||
return self.md.renderInline(chat_message)
|
||||
else:
|
||||
raise ValueError(f"Invalid message for Chatbot component: {chat_message}")
|
||||
|
@ -1 +1 @@
|
||||
3.24.0
|
||||
3.24.1
|
||||
|
@ -1700,8 +1700,8 @@ class TestChatbot:
|
||||
Postprocess, get_config
|
||||
"""
|
||||
chatbot = gr.Chatbot()
|
||||
assert chatbot.postprocess([["You are **cool**", "so are *you*"]]) == [
|
||||
["You are <strong>cool</strong>", "so are <em>you</em>"]
|
||||
assert chatbot.postprocess([["You are **cool**\nand fun", "so are *you*"]]) == [
|
||||
["You are <strong>cool</strong><br>and fun", "so are <em>you</em>"]
|
||||
]
|
||||
|
||||
multimodal_msg = [
|
||||
|
Loading…
Reference in New Issue
Block a user