Problems with code of midiscript in one message

I have been trying to write some code lines here:

Finally I pasted images of the code instead the code itself.

This was the message shown with the code of the image :

And this was the same with the code formatted as code:

Don’t know if the use of “@” in the code is causing these weird things

Yes, I have noticed the same, and the “@” is the cause. Discourse tries to find the user you are referencing with @, which disrupts the formatting. I can switch off this behavior for the entire forum, which I don’t want to do, so the only alternative, as you have found out, is to add the text as a code block.

When I pasted the code in a code block, I had the same problem.

I can paste into code blocks without problems. The important thing is to create a code block first and then paste into it, not to paste the text and then make it a code block. How did you proceed when you got the problem in code blocks?

Yes, I pasted the code as normal text, then select the code text and click the code block icon.

I always repeat these steps in forum posts.

I will change the order, well noted.