8

It appears that Ruby class variables aren't fully highlighted on Stack Overflow:

class Foo
 @class_instance_var = 1 # fine
 @@class_var = 2 # not fully highlighted
end

The class instance variable gets full highlighting, but the double @ seems to throw the highlighter a bit.

Here's an SO question with this in action: Why should @@class_variables be avoided in Ruby?

Update: 5th April

I've submitted an issue to the google prettify repository, with a patch that appears to solve the problem. Thanks to @CodyGray for the information.

2
  • 1
    Upvoted, since this happens even if you use language-specific syntax highlighting. Commented Apr 4, 2013 at 16:18
  • Removed previous wrong comment of mine and its answer. Commented Apr 5, 2013 at 16:16

1 Answer 1

1

The Stack Exchange team outsources code highlighting to Google Prettify, so this bug will need to be filed with and corrected by the Prettify team.

Once Prettify is updated, the latest version can be deployed across the network. (You might need to ping one of them with a request to do so.)

It might be a simple fix. If you know how to do it yourself, you might go ahead and submit a patch.

Related:

answered Apr 5, 2013 at 4:59
1
  • Thanks, I've created an issue and submitted a patch on google prettify. Commented Apr 5, 2013 at 9:13

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.