summaryrefslogtreecommitdiff
path: root/lib/coderay
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2006-10-18 21:48:17 +0000
committermurphy <murphy@rubychan.de>2006-10-18 21:48:17 +0000
commit3f5cc3ae69ecad6a6909aad4b553eb958241dd14 (patch)
treef488993bf2c9761c6f98ca5ddd55497f6fa8f832 /lib/coderay
parent26a698230e2e502bfe90392ae034409506ca3cdc (diff)
downloadcoderay-3f5cc3ae69ecad6a6909aad4b553eb958241dd14.tar.gz
Ruby scanner: #{...} delimiters are now :inline_delimiter to solve CSS problem.
New token: :inline_delimiter Scanner tests suite revamped: colorization, split up into methods.
Diffstat (limited to 'lib/coderay')
-rw-r--r--lib/coderay/encoders/html/classes.rb1
-rw-r--r--lib/coderay/scanners/ruby.rb4
-rw-r--r--lib/coderay/styles/cycnus.rb2
3 files changed, 4 insertions, 3 deletions
diff --git a/lib/coderay/encoders/html/classes.rb b/lib/coderay/encoders/html/classes.rb
index c8f70d9..0bac742 100644
--- a/lib/coderay/encoders/html/classes.rb
+++ b/lib/coderay/encoders/html/classes.rb
@@ -34,6 +34,7 @@ module Encoders
:hex => 'hx',
:include => 'ic',
:inline => 'il',
+ :inline_delimiter => 'idl',
:instance_variable => 'iv',
:integer => 'i',
:interpreted => 'in',
diff --git a/lib/coderay/scanners/ruby.rb b/lib/coderay/scanners/ruby.rb
index d15af0d..def5960 100644
--- a/lib/coderay/scanners/ruby.rb
+++ b/lib/coderay/scanners/ruby.rb
@@ -97,7 +97,7 @@ module Scanners
state = :initial
depth = 1
tokens << [:open, :inline]
- tokens << [match + getch, :delimiter]
+ tokens << [match + getch, :inline_delimiter]
when ?$, ?@
tokens << [match, :escape]
last_state = state # scan one token as normal code, then return here
@@ -189,7 +189,7 @@ module Scanners
depth -= 1
if depth == 0 # closing brace of inline block reached
state, depth, heredocs = inline_block_stack.pop
- tokens << [match, :delimiter]
+ tokens << [match, :inline_delimiter]
kind = :inline
match = :close
end
diff --git a/lib/coderay/styles/cycnus.rb b/lib/coderay/styles/cycnus.rb
index 8464ba3..df982e1 100644
--- a/lib/coderay/styles/cycnus.rb
+++ b/lib/coderay/styles/cycnus.rb
@@ -76,7 +76,7 @@ ol.CodeRay li { white-space: pre }
.il { background: #eee }
.il .il { background: #ddd }
.il .il .il { background: #ccc }
-.il .dl { font-weight: bold ! important; color: #888 ! important }
+.il .idl { font-weight: bold; color: #888 }
.in { color:#B2B; font-weight:bold }
.iv { color:#33B }