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)
I found 1 similar thread that might be helpful:
- Chainlit (2.2.0 - 2.4.201) Still Has Several Issues Formatting Copy/Pasted Code & Text Content - No solution was found in the comments.
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
I now have the same extra new lines issue out of no where, running the latest version.
Still having the same issue with 2.5.5
There were a lot of bugs in V2 chat pasting typing area, this one seems to be the last one but its been there for a while now!
This issue is stale because it has been open for 14 days with no activity.