If you hit Shift + Enter while writing a message in Chat and continue onto the new line, when you submit your message, it will be automatically converted into a code block.
Instead, it should be left as normal text.
For info, we're experimenting with some changes to this area:
This should give us a fairly consistent behaviour (vs SOFU/SE), while retaining the flexiblity to post both types of message
This is completely by design, though. The typical chat message will be a single line; anything other than that should be multiple chat messages.