I previously resolved this by applying a solution found in the thread linked below, but the most recent update to Discourse has unfortunately undone that fix. I posted in the thread and plan to contact Discourse support in hopes of a resolution.
In the meantime, you can three backticks before and after a code block like so:
```
your code
here
```