Preserve text colours when compiling

I am writing a text in scrivener 3 with comprise snippets of codes,
I copy them with their syntax highlighting in scrivener and i can perfectly visualise them in the editor (screenshot below). However, when I compile the text, all the snippets have lost their colours.
I wonder if there any specific option that trigger this behaviour or how can I avoid it.

I tried using a specific style for the code block, but I still have the same problem.

I, unfortunately, found the solution only after I posted here. There is an option “remove text color” in the setting of the compile section (see screenshot).