Ask coding questions

← Back to all posts
I have a textarea in my chat, I can multiline in it but when I send it, it's only one line.
h
UnluckyFroggy (920)

I have a textarea in my chat, I can multiline in it but when I send it, it's only one line. I want it to stay multilined after I send.

It's socket.io and Node.js

Chatroom Link

Comments
hotnewtop
LukeWright (237)

Why don't you have something like old telegraphs used where there is a symbol used to denote the end of a line. Then in your code, display it as multiple lines, splitting the message whenever it sees the symbol.

message = "hellofriends#mynameisluke"
listified = []
listified = message.split("#")
for ln in listified:
 print(ln)
Andy_4sberg (52)

@LukeWright, this symbol could be better: ‖, it isn't an any keyboard (that I know of).