chainlit
chainlit copied to clipboard
Chainlit 2.4.400 - Pasting Content Adds an Extra Newlines Between Each Line
Describe the bug
The 2.4.400 release, and specifically #2075 fixed the majority of the issues I expressed in #2032, which I greatly appreciate! Unfortunately, there seems to be one new issue with pasted content, making pasting code into Chainlit still not very feasible.
When pasting any content containing multiple lines, both code and regular text will now have additional newlines inserted between each line directly within the chat input box. This is not the same as what would happen previously, as additional newlines used to only show up in code blocks and they would only appear after sending content to the UI; they were not visible in the message composer. I tested copying from a Linux VM and a Windows VM from a Windows host machine, and both produced identical results.
To Reproduce
Copy and paste any code from an editor like VSCode or PyCharm into Chainlit's message input box. You will see the additional newlines upon pasting.
Below is a quick video showcasing the issue happening:
https://github.com/user-attachments/assets/e7fa6976-1282-4b9b-a6ca-7cb721c043a7
Expected behavior
Chainlit needs to be able to handle a user's content/code without modifying its formatting.
Desktop
- OS: Windows 11
- Browser Microsoft Edge
- Version: 134.0.3124.93 (Official build) (64-bit)