Isn’t that already achieved by using the code block, which gives you syntax highlighting in the preview area?