What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 127 Stack Exchange communities.

I went to edit a C++ question to fix the code formatting but noticed that the code seemed to already be properly formatted for markdown. The syntax highliting works but every line is starting at the left margin (no indentation). The post is using spaces to for indentation of inner blocks but the Markdown preview still shows no indentation. I added two spaces before the newline on previous lines with no success. I've search Meta for other Markdown bugs relating to code block indentation but came up empty. the closest question I could find was this one but it isn't helpful because when I use the code button the selected block gets removed and when I use the code button a second time the code block comes back but only the syntax highlighting works and the code is still unindented.

For example, when I add the following, it shows up highlighted but unindented both in the SO question and here on Meta. I'm using Internet Explorer 8 on Windows 7. I'm using normal crlf and spaces with no tabs.

for(int x = 0; x < 10; x++)   
    print(x);

To me looks the same as

for(int x = 0; x < 10; x++)   
print(x);
share|improve this question
    
The code is using tabs for several levels instead of spaces. This causes the problems and is not a bug. –  Bart Feb 20 '13 at 15:51
    
The first few lines are not using tabs. I even deleted all the white space and inserted new crlf and spaces for just the case you mention. I did not go convert the whole codeblock once I saw that the indentation was not working for the first few lines I attempted to correct. –  Kelly S. French Feb 20 '13 at 15:57
    
I just now corrected the code block. All I did was exchange tabs for spaces. Seems to be fine now? If it doesn't look good to you, what browser and version are you using? –  Bart Feb 20 '13 at 16:06
    
It still shows up unindented to me using IE8 on Windows 7. I also created a new source block of two lines of Python which also become highlighted but the indentation was lost. I canceled that edit to check your version but have inserted it here to see if there was a difference between Markdown on SO vs. Meta. –  Kelly S. French Feb 20 '13 at 16:18
1  
Are you by any chance using a compatibility mode in your browser? I do recall a code indentation issue for IE7. –  Bart Feb 20 '13 at 16:22
add comment

1 Answer

Turn off IE8's Compatibility mode.

It was on and when I turned it off the indentation was correct. I've edited the question's title to reflect this. I'd guess the IE7 issue is still there in IE8.

share|improve this answer
    
Yeah, the IE definition of "compatibility" is "if it was broken back then, it should also be broken now" (which is kind of a good thing for a web dev, since you don't have to install every single IE version you want to test in). –  balpha Feb 20 '13 at 20:19
    
"kind of a good thing for a web dev" ...unless, @balpha, you happen to be developing but don't know that IE by default enables this compatibility mode for what it thinks are intranet sites, and worse: without showing the button to disable that... –  Arjan Feb 20 '13 at 20:33
    
@Arjan Fortunately my corporate environment is different kinds of insane :) –  balpha Feb 20 '13 at 20:38
    
Ah, a move, @balpha! Does that bring the remote worker closer to the office, or even further away? ;-) –  Arjan Feb 20 '13 at 20:41
add comment

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .