summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2012-01-21 04:46:18 -0800
committerKornelius Kalnbach <murphy@rubychan.de>2012-01-21 04:46:18 -0800
commit185c4222c4be23cec40b3a91bb8ae481aff398bc (patch)
tree1a616a30b587f16dde8cff2ca4e981b6e9fde5ce
parent9c3837e0086ca07f241e9cc74c9fabbeb2d39987 (diff)
parente099e73ec807898d704177b7c6d246b35d03b1a3 (diff)
downloadcoderay-185c4222c4be23cec40b3a91bb8ae481aff398bc.tar.gz
Merge pull request #13 from noprompt/master
Highlight CSS functions as :function
-rw-r--r--.gitignore1
-rw-r--r--lib/coderay/scanners/css.rb4
2 files changed, 3 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 80d9aa1..2bb9385 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,3 +20,4 @@ test/scanners
bench/test.div.html
diff.html
etc/CodeRay.tmproj
+*.swp
diff --git a/lib/coderay/scanners/css.rb b/lib/coderay/scanners/css.rb
index 34eaecb..7b731ef 100644
--- a/lib/coderay/scanners/css.rb
+++ b/lib/coderay/scanners/css.rb
@@ -144,7 +144,7 @@ module Scanners
encoder.end_group :string
elsif match = scan(/#{RE::Function}/o)
- encoder.begin_group :string
+ encoder.begin_group :function
start = match[/^\w+\(/]
encoder.text_token start, :delimiter
if match[-1] == ?)
@@ -153,7 +153,7 @@ module Scanners
else
encoder.text_token match[start.size..-1], :content
end
- encoder.end_group :string
+ encoder.end_group :function
elsif match = scan(/(?: #{RE::Dimension} | #{RE::Percentage} | #{RE::Num} )/ox)
encoder.text_token match, :float