I’ve found a convenient workaround for a bug where you copy code and it got past as an attachment instead of text in the chat. I used it a lot and it stressed me out that I needed to copy paste it somewhere to make it behave not like attachment.
The solution (Mac only) is this shortcut:
Apparently cursor looks for indentations and when I break the pattern it no longer consider code as an attachment and allows to insert it into conversation
I have it placed in dock so I copy paste, click icon on dock and insert as normally, but you can also attach a keyboard shortcut on that.
I’ve done it on my work machine where I don’t have access to iCloud so cannot share, but you probably can recreate from the image
The regex there - ^[ ]*