Rendering code in a copyable format for pdfs

Hello! I use obsidian a lot to generate reports instead of LateX because I tend to want to paste in code and have it be in a format where the reader can copy the code, paste it in an IDE and have it run with no missing indentation.

A previous version of obsidian really did this well 1.8.9 and in the newer version im using 1.8.10, this feature seems to be lost. I really want the whitespace at the start not to be lost please, is there some kind of setting or css snippet I can use to bring back this functionality?
Ive attatched screenshots of the visible whitespace present in a pdf generated before and after the update. For some reason pdf is really annoying with this for latex as well so if I could get some insight on HOW the whitespace was preserved in the pdf before, that would be great too, I imagine it’s due to some form of HTML rendering.
Previous version:

New version: