0

I've posted that answer: https://stackoverflow.com/a/17989511/2605780 and I was fighting a bit with indentation.

No matter what I've set, spaces or tabs, there is no indentation displayed. Both spaces and tabs are ignored. But if you edit a post, you see, that indentation is there.

I see that problem in other places, so it seems to be a problem with Java code in particular, because I haven't notice such problems with Javascript or HTML code blocks.

edit
I'm stuck with IE8, additionally I can't control compatibility settings. So I change 'bug' to 'discussion' with question:

Is the code indentation (and other code formatting/syntax highlighting issues) known and officially confirmed not to work with such configuration?

17
  • 1
    Err, it looks indented to me? Commented Aug 1, 2013 at 9:05
  • Looks OK to me. Are you getting any JavaScript errors? What happens after a hard refresh (Ctrl + F5)? Commented Aug 1, 2013 at 9:06
  • @Oded after hard refresh I see the code unindented and unhighlighted, after about 1 second highlighting is activated. Commented Aug 1, 2013 at 9:10
  • @WebDevie: The highlighting is applied with a javascript that runs after page load. If you see that much delay your browser is being awfully slow at applying the script. Commented Aug 1, 2013 at 9:11
  • Can you post screenshot and specify what browser you're using? Commented Aug 1, 2013 at 9:11
  • @MartijnPieters true, but indentation is part of the raw HTML, it's not applied with JS. Commented Aug 1, 2013 at 9:12
  • IE8, unfortunatelly I can't make screenshots when accessing internet. Commented Aug 1, 2013 at 9:12
  • 2
    IE8 is no longer supported. Commented Aug 1, 2013 at 9:13
  • @ShaWizDowArd: If there is a browser extension or user CSS that misconfigures the default CSS for a <pre> tag whitespace could first be displayed collapsed. Commented Aug 1, 2013 at 9:13
  • What is so weird about your computer's configuration that you can neither A) use debugging tools built into your browser, and B) take screenshots? Commented Aug 1, 2013 at 9:15
  • @WebDevie do you see it this way? If so it means your browser went to Quirks mode. Commented Aug 1, 2013 at 9:15
  • I can't access internet from my computer, I can only run remote browser, in that case IE8. Commented Aug 1, 2013 at 9:16
  • @MartijnPieters OK I seen that stackoverflow.com is added to compatibility mode, but this option is made read-only for me. Does it mean I will have to live with not being able to see indentation? Commented Aug 1, 2013 at 9:19
  • @WebDevie: If you are stuck with IE8 in compatibility mode, then yes, you are not going to get the full Stack Overflow experience. Commented Aug 1, 2013 at 9:22
  • 1
    google.com/chromeframe Commented Aug 1, 2013 at 9:27

1 Answer 1

3

You used tabs to indent the lines. Tabs are 'funny' in that their indent sticks to a tabstop, at 8 spaces. Adding spaces in front of them doesn't work, up to a point until you add enough.

Add to that that this is browser dependent; Stack Overflow on the other hand interprets tabs as 4 spaces instead.

I replaced all tabs with spaces.

However, if you are stuck on IE8 fixed in Compatibility Mode, you are not going to get the full Stack Overflow experience. IE8 is no longer supported by the developers, and Compatibility Mode has never been supported.

4
  • Although that might be true and I always prefer spaces over tabs... (1) it displayed fine for me before your edit, and (2) indenting with multiple tabs works fine. Commented Aug 1, 2013 at 9:09
  • As I've said, I've tried with both spaces and tabs. None of them work for that code sample. I think it may be an issue with syntax highlighter, since it is client-side, unfortunatelly, I have no possibility to use development tools or anything like that for internet sites to inspect that :( Commented Aug 1, 2013 at 9:09
  • @CodyGray: Sure, it did for me too; it was my guess as to why the OP saw strange unexpected behaviour. Commented Aug 1, 2013 at 9:10
  • 1
    @WebDevie: It certainly was working fine for me. Sounds like a local browser problem; maybe you should add screenshots. Commented Aug 1, 2013 at 9:10

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.