It's not a bug, it's a feature™
As soon as you save a question, we normalize whitespace in code blocks. All tabs get turned into spaces. This way we can guarantee that whitespace in our code snippets is consistent and uniform. This behavior didn't change with the migration to CommonMark, we've done this kind of heresy before.
You're right that this makes things for Makefile
samples harder when it comes to copy/pasting. I recommend adding an explicit explanation that readers should use tabs, not spaces, when writing a make
snippet. Even if we didn't do this kind of normalization, this would be a good addition as you never know whether readers copy/paste or type out your code snippet and mistake your tabs for spaces.
Be assured, this is not part of a bigger plot to finally settle the tabs vs spaces discussion. It's more a pragmatic decision to make everyone's favorite pastime, copy/pasting from Stack Overflow, a little more pleasant by presenting something that's consistent. You'd be surprised how many code snippets we see that include a wild mix of tabs and spaces.
Edit: As Peter Mortensen rightly pointed out (sorry, my explanation was too sloppy): converting tabs to spaces happens when we convert your post from Markdown to HTML. This happens once whenever you change your post. We store the rendered HTML and serve that when users are viewing your post. Your original Markdown will remain unchanged.
makefile
, what other tools/languages require use of TAB character?source
view from the revision history (and during editing).source
view for your example. The TABs are preserved (and not converted when saved) and can be copy-pasted from that page (and during editing). They are only converted for rendering purposes (a sort of caching?).