Formatting of using <code> tag is kept in VS

Hey ! first post here and im desperate to be finished with this technical document page. I stuck on a silly little thing which i just cant wrap my head around!. Im wondering if anyone has a fix or a bit of help as to why im getting this error as shown in the images…

which gives me

can anyone explain ?

It seems to keep the ofrmatting from Vs code, i tried it in codepen and its the same…something im missing ??

How is the <code> tag supposed to know how many spaces you’d like to have removed and which ones to keep?

I think the only way to avoid this is to put your <code> tag to the very left edge of the editor (not indented).