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.

UPDATE: It's formatted correctly after posting the question. Here's a screenshot of what it looks like when creating the question: http://cl.ly/3u072T2K0F2P2A2n0d3Q. I'm on Chrome v19.

Here's a d-paste of the code that I can't seem to format correctly on Stack Overflow: http://dpaste.com/765025/copy/.

Here's the code pasted as is, I've tried writing it manually as well... what could be the reason for this problem?

onTwitterInit : function () {
    if (window.twttr) {
        var that = this;
        window.twttr.anywhere(function (T) {
    
    
            T.bind("tweet", $.proxy(that.onTweet, that));
            T.bind("follow", $.proxy(that.onFollow, that));
            T.bind("authComplete", $.proxy(that.onAuthComplete, that));
            T.bind("signOut", $.proxy(that.onSignOut, that));
            $.subscribe(EVENTS.LOGIN, function (e) {
                T.signIn();
            });
            $.subscribe(EVENTS.POST_STATUS, function (e, data) {
                if (T.isConnected()) {
                    T.Status.update(data.text); 
                } else {
                    that.customTweet(e, data);
                }
            });
            $.subscribe(EVENTS.GET_STATUS, function (e) {
                if (T.isConnected()) {
                    that.onAuthComplete(null, T.currentUser)
                } else {
                    that.onSignOut();
                }
            });
        });
    }
}
share|improve this question
6  
Care to explain what the problem is? Looks formatted alright. –  Daniel Fischer Jun 28 '12 at 20:47
1  
Browser? O/S? Screen shot demonstrating the problem? –  Aaron Bertrand Jun 28 '12 at 20:50
1  
Chrome 19 - uh and yes it is now aligned correctly - it was not aligned correctly in the preview mode –  potench Jun 28 '12 at 20:57
1  
Screenshot: cl.ly/3u072T2K0F2P2A2n0d3Q –  potench Jun 28 '12 at 20:58
add comment

2 Answers

up vote 15 down vote accepted

I reproduced that

onTwitterInit : function () {
    if (window.twttr) {
        var that = this;
        window.twttr.anywhere(function (T) {


doesn't get rendered properly in the preview:

screenshot

The culprit is a Unicode character (code 8232) following the { on the last line. If you remove it, the rendering problems disappears.

U+2028 is the Unicode character 'LINE SEPARATOR', and the preview engine doesn't seems to handle it properly. I checked on Chrome, Firefox and IE. All have the same problem.

share|improve this answer
    
Thanks! Was driving me crazy –  potench Jun 28 '12 at 21:11
add comment

Is this what you are seeing?

IE9 Compatibility Mode

enter image description here

If so, then turn off Compatibility Mode

IE8 Mode

enter image description here

IE9 Mode

enter image description here

share|improve this answer
1  
I'm in chrome - thanks for the fast response - it's only unformatted when previewing the question - on a side note, I did not know you could include screenshots, so thanks +1 –  potench Jun 28 '12 at 21:00
add comment

You must log in to answer this question.

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