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 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:

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

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