Testing Syntax Highlighter

+1 Bucky Roberts · July 30, 2014
Python
@requires_authorization
def somefunc(param1='', param2=0):
r'''A docstring'''
if param1 > param2: # interesting
print 'Gre\'ater'
return (param2 - param1 + 1 + 0b10l) or None

class SomeClass: pass

>>> message = '''interpreter
... prompt'''

Ruby
class A < B; def self.create(object = User) object end end
class Zebra; def inspect; "X#{2 + self.object_id}" end end

module
include Comparable

# @param test
# @return [String] nothing
def foo(test)
Thread.new do |blockvar|
ABCreverse(:a_symbol, :'a symbol', :<=>, 'test' + ?\012)
answer = valid?4 && valid?CONST && ?A && ?A.ord
end.join
end

def [](index) self[index] end
def ==(other) other == self end
end

class Car < ActiveRecord::Base
has_many :wheels, :class_name => 'Wheel', :foreign_key => 'car_id'
end
omega = -> { 'alpha' }
alpha = ->(arg) { arg*2 }
hash = {1 => 'one', 2 => 'two'}

anIdentifier = an_identifier
Constant = 1
render action: :new

str =~ /^(?:foo)$/
str =~ %r{foo|bar|buz$}
str =~ %r!foo|bar$!
str =~ %r[foo|bar$]
str =~ %r(\(foo|bar\)$)

2.0.0p0 :001 > ['some']
=> ["some"]
2.0.0p0 :002 > if true
2.0.0p0 :003?> "yop"
2.0.0p0 :004?> end
=> "yop"

>> obj = OpenStruct.new :integer => 987, :symbol => :so_great
=> #<OpenStruct integer=987, symbol=:so_great>
>> [obj,obj,obj]
=> [#<OpenStruct integer=987, symbol=:so_great>, #<OpenStruct integer=987, symbol=:so_great>, #<OpenStruct integer=987, symbol=:so_great>]
>> {1 => obj, 2 => obj}
=> {1=>#<OpenStruct integer=987, symbol=:so_great>, 2=>#<OpenStruct integer=987, symbol=:so_great>}
>> if 10 > 20
>> "YEAH"
>> else
?> "NO"
>> end
=> "NO"


Perl

# loads object
sub load
{
my $flds = $c->db_load($id,@_) || do {
Carp::carp "Can`t load (class: $c, id: $id): '$!'"; return undef
};
my $o = $c->_perl_new();
$id12 = $id / 24 / 3600;
$o->{'ID'} = $id12 + 123;
#$o->{'SHCUT'} = $flds->{'SHCUT'};
my $p = $o->props;
my $vt;
$string =~ m/^sought_text$/;
$items = split //, 'abc';
$string //= "bar";
for my $key (keys %$p)
{
if(${$vt.'::property'}) {
$o->{$key . '_real'} = $flds->{$key};
tie 'CMSBuilder::Property', $o, $key;
}
}
$o->save if delete $o->{'_save_after_load'};

# GH-117
my $g = glob("/usr/bin/*");

return $o;
}

Post a Reply

Replies

- page 1
Oldest  Newest  Rating
+1 Yannis Sp · August 26, 2014
Yes its ok now :)
Good job :P
+1 Bucky Roberts · August 26, 2014
It should be a little better now. 
+1 Yannis Sp · August 25, 2014
All the replies.Good thing is that this happens only when you post highlighted code.Other posts on forum are ok.
+1 Bucky Roberts · August 25, 2014
You mean not the main topic, but all the replies?
+1 Yannis Sp · August 25, 2014
And also the other posts take the width of the last social network icon of the first post(idk if you understand me).
-1 Bucky Roberts · August 25, 2014
Well, at least I have something else to work on now  :getlost:  haha
-1 Yannis Sp · August 25, 2014
Holy shit it is a bug.Even though i have disable the adblock for the site it messes up the dimensions of the forum elements.Check how i watch the page./images/forum/upload/2014-08-25/3135a67aa5befaa76d5e3024e4cee4d9.png
0 Bucky Roberts · August 25, 2014
Does it look like this?

/images/forum/upload/2014-08-25/d83ca6cd98a88889e8179c84d1424b4c.png
0 Yannis Sp · August 25, 2014
Google chrome.Maybe the adblock but i have disabled it for this page..
0 Bucky Roberts · August 25, 2014
It should be limited by the forums max-width. It seems fine on my computer. What browser are you using?
  • 1
  • 2

Bug Reports

107,138 followers
About

Found a bug on the site? Report it here. For all security related bugs, please send me a private message.

Links
Moderators
Bucky Roberts Administrator