Hi TearsOfSky and welcome to the Mattermost forums!
I’m unable to follow your reproduction instructions, sorry.
So on the desktop client you can send a message using the code block formatting just fine. Afterwards, when you want to edit this message and add an additional line to it, f.ex., you’re then unable to save it, is that correct? If so, I’m unable to reproduce that on my test systems here.
What mattermost server version are you using?
What mattermost desktop client version are you using?
What operating system are you working on?
It seems as if the syntax detection does not work upon editing and defaults to some non-specific value, you can (however) force the syntax detection which will then make it look like you entered the code correctly right from the beginning:
Step 3, Method 2:
Result:
This has been tested on 7.2.0 - let me know if your experience differs from mine here and if so, in what step so I can try to spin up a 6.6.1 instance and try to dig a bit deeper here.
Doesn’t really matter - the buttons just emulate the ENTERand ESCAPE events, but I booted my 6.6.1 installation now and found out that hitting ENTER did not close the box, but CTRL-ENTER does (the rest behaves exactly the same). So please just use CTRL-ENTER to close the box.