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

I answered this question on StackOverflow:

detect time taken to load url in UIWebView in iphone?

It has been now edited, but the problem with the original revison is, the code in the second line is not actually marked as code, it seems the markup engine fails to correctly interpret the indentation. I have indented that line with at least 4 (actually 8) spaces. The same weird thing happened to me earlier this day also.

What's going on with SO? Am I doing something wrong?

share|improve this question
    
There was probably a tab in there or a special character (an invisible one) most likely copied in from the original paste operation. The edit removed it it seems. –  jmort253 Jul 28 '12 at 8:26
    
    
@jmort253 thanks - but I haven't pasted in anything... Nevermind. If you make it an answer, I'll accept it. –  H2CO3 Jul 28 '12 at 8:27
1  
Why accept anything that doesn't solve things for you? –  Arjan Jul 28 '12 at 8:29
    
And did you see balpha's request in the post I linked to? He asks "please see if the text area has a changed white-space setting". –  Arjan Jul 28 '12 at 10:27

1 Answer 1

up vote 3 down vote accepted

Tabs or a special character (an invisible one) most likely copied in from the original paste operation, can have an effect on the way the editor interprets the markup. The edit removed it it seems.

I investigated the first revision and edited it myself. Removing the 4 blank characters and replacing them with normal spaces resolves the problem.

In this case, editing the post to fix the code formatting is indeed the correct course of action. In short, you're not doing anything wrong, just make sure it's 4 actual spaces (ASCII code 32 type spaces) and all will work just fine.

For more specifics, an online ASCII converter detected 4 regular spaces before the actual line of code, but it also detected a NULL value. I also confirmed through trial and error that the very first space, when deleted and re-entered, fixed the formatting; thus, it may not be necessary to replace all 4 spaces in these situations.

Line entered from the actual first revision:

  NSURLRequest *requestObj = [NSURLRequest requestWithURL:url

Output from ASCII converter:

NULL 32 32 32 32 
share|improve this answer
1  
The first char is actually 0xA0 ie NBSP. –  Mat Jul 28 '12 at 8:45
    
I read that in the linked post. Maybe it's because I converted to the actual numerical ASCII codes instead of HTML. At any rate, there are other characters that could affect the markup as well. I've cleaned up plenty of poorly formatted questions that had tabs instead of spaces. Now that's a real nightmare to clean up. –  jmort253 Jul 28 '12 at 8:47
2  
0xA0 is outside of 7-bit ASCII which is what that converter is using. It's NBSP in Latin1 and other ISO-8859 charsets. –  Mat Jul 28 '12 at 8:50
    
I've cleaned up plenty of poorly formatted questions that had tabs instead of spaces — But Tabs should be okay, and the preview should match the actual rendering? Of course, if people are only peeking into the editor textarea, then things might look horrible. (Kudos for fixing that then.) –  Arjan Jul 28 '12 at 9:03

You must log in to answer this question.

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