Code embeds from Github display mangled

Embedding a Github gist results in code with random whitespace missing.

To reproduce:
 1. Edit an Instructable.
 2. Click the "add" button, then click "Video".
 3. In the URL field, enter the URL of a Github gist (for example, https://gist.github.com/anonymous/c4286979ded2d927b40a71fdd75038df)
 4. Click "Preview", then "Done".
 5. Save changes to the Instructable, then view it.

The embedded code from Github will be mostly correct, but random whitespace characters will be missing (both leading whitespace and whitespace between words).  In the attached screenshot, the code inside the function is supposed to have 4 leading spaces.  The function signature should also read "static int pad_open" instead of running everything together.  You can view the original code using the URL above to compare what's being displayed with what's actually showing up.

It's not clear whether this is a bug on the Instructables side or on the Github side.  I don't have any way to debug it from my end, so I thought I'd ask about it here before complaining to Github.

I am using Firefox v52.0.2 on Windows 7 (64-bit).

Picture of Code embeds from Github display mangled

Well, you don't use the video button to embed code, you that using HTML.
And instead of trying to get the code into here I would just link to the Github page instead, at least this way users can benefit from possible updates and changes to the code.