I'm not sure I understand the issue. Are you unable to have your example format as a code block in Trello? When testing your text, I'm afraid I don't see any issues:
Would you mind sharing a screenshot of a card (with the description editing opened) where you are experiencing this issue please?
If you had to thrive a new habit during a lockdown, what would it be? Trello
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event