summaryrefslogtreecommitdiff
path: root/lib/coderay/scanners/css.rb
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2009-10-19 17:01:50 +0000
committermurphy <murphy@rubychan.de>2009-10-19 17:01:50 +0000
commit95d8e4299ee5c4f7227b367415eb301313f6cb83 (patch)
treeec9db6a3f8a55c66afb15cb1c60e5a7b30acaa25 /lib/coderay/scanners/css.rb
parent6d6daf996226c3665bdefaeda642163555d96e24 (diff)
downloadcoderay-95d8e4299ee5c4f7227b367415eb301313f6cb83.tar.gz
Updated CSS scanner: element selectors are highlighted as :type.
Diffstat (limited to 'lib/coderay/scanners/css.rb')
-rw-r--r--lib/coderay/scanners/css.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/coderay/scanners/css.rb b/lib/coderay/scanners/css.rb
index bfa8bda..93e8d80 100644
--- a/lib/coderay/scanners/css.rb
+++ b/lib/coderay/scanners/css.rb
@@ -5,6 +5,14 @@ module Scanners
register_for :css
+ KINDS_NOT_LOC = [
+ :comment,
+ :class, :pseudo_class, :type,
+ :constant, :directive,
+ :key, :value, :operator, :color, :float,
+ :error, :important,
+ ]
+
module RE
NonASCII = /[\x80-\xFF]/
Hex = /[0-9a-fA-F]/
@@ -58,7 +66,7 @@ module Scanners
elsif case states.last
when :initial, :media
if scan(/(?>#{RE::Ident})(?!\()|\*/ox)
- kind = :keyword
+ kind = :type
elsif scan RE::Class
kind = :class
elsif scan RE::Id