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.
-
1Upvoted, since this happens even if you use language-specific syntax highlighting.Nightfirecat– Nightfirecat2013年04月04日 16:18:53 +00:00Commented Apr 4, 2013 at 16:18
-
Removed previous wrong comment of mine and its answer.Sklivvz– Sklivvz StaffMod2013年04月05日 16:16:46 +00:00Commented Apr 5, 2013 at 16:16
1 Answer 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:
-
Thanks, I've created an issue and submitted a patch on google prettify.Jon Cairns– Jon Cairns2013年04月05日 09:13:14 +00:00Commented Apr 5, 2013 at 9:13