Formatted Code is not rendered in the editor. The coloring is applied when the website is published.
Edit your code in the editor and select the language you want to be used for the syntax coloration.
If it doesn't work when the website is published:
This feature requires the PrismJS Package to be deployed with your website.
Open the Website settings dialog in the Website ribbon tab, go to the Packages section and enable PrismJS.
You must redeploy your website for the modification to apply.
Note: This Package is enabled by default when you create a new website in PageFabric.