summaryrefslogtreecommitdiff
path: root/lib/coderay
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2013-06-12 16:19:41 +0200
committerKornelius Kalnbach <murphy@rubychan.de>2013-06-12 16:19:41 +0200
commit65eeaca6c18bea379b966559084e47d6fb45c75c (patch)
tree4b3ce31d5ef4ec5d1f9e3367ded754bbd3757d51 /lib/coderay
parent40bd2ef5d33d32c3b3987da1d115b717259819e4 (diff)
downloadcoderay-65eeaca6c18bea379b966559084e47d6fb45c75c.tar.gz
add python binary string
Diffstat (limited to 'lib/coderay')
-rw-r--r--lib/coderay/scanners/python.rb4
-rw-r--r--lib/coderay/styles/alpha.rb4
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/coderay/scanners/python.rb b/lib/coderay/scanners/python.rb
index a9492ab..09c8b6e 100644
--- a/lib/coderay/scanners/python.rb
+++ b/lib/coderay/scanners/python.rb
@@ -157,12 +157,12 @@ module Scanners
encoder.text_token match, :operator
elsif match = scan(/(u?r?|b)?("""|"|'''|')/i)
+ modifiers = self[1]
string_delimiter = self[2]
- string_type = docstring_coming ? :docstring : :string
+ string_type = docstring_coming ? :docstring : (modifiers == 'b' ? :binary : :string)
docstring_coming = false if docstring_coming
encoder.begin_group string_type
string_raw = false
- modifiers = self[1]
unless modifiers.empty?
string_raw = !!modifiers.index(?r)
encoder.text_token modifiers, :modifier
diff --git a/lib/coderay/styles/alpha.rb b/lib/coderay/styles/alpha.rb
index f57e4a1..2ad088a 100644
--- a/lib/coderay/styles/alpha.rb
+++ b/lib/coderay/styles/alpha.rb
@@ -56,7 +56,9 @@ table.CodeRay td { padding: 2px 4px; vertical-align: top; }
.annotation { color:#007 }
.attribute-name { color:#b48 }
.attribute-value { color:#700 }
-.binary { color:#509 }
+.binary { color:#549 }
+.binary .delimiter { color:#325 }
+.binary .char { color:#325 }
.char .content { color:#D20 }
.char .delimiter { color:#710 }
.char { color:#D20 }