summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2010-04-14 23:07:17 +0000
committermurphy <murphy@rubychan.de>2010-04-14 23:07:17 +0000
commitb9ce754961ea97dda8368f0a53d2113840b8f168 (patch)
treee10a931045d9df4f852c4e0105770079be851e7e
parentfbfcd8d3dab8ee3310f8653113a0bbaae16e76f2 (diff)
downloadcoderay-b9ce754961ea97dda8368f0a53d2113840b8f168.tar.gz
CSS Scanner: Adding support for CSS 3 functions and colors, changing highlighting of attrbiute selectors (closes #224).
-rw-r--r--Changes.textile22
-rw-r--r--etc/coderay-lib.tmproj55
-rw-r--r--lib/coderay/scanners/css.rb12
-rw-r--r--test/scanners/css/coderay.expected.raydebug124
-rw-r--r--test/scanners/css/coderay.in.css124
-rw-r--r--test/scanners/css/demo.expected.raydebug55
-rw-r--r--test/scanners/css/demo.in.css55
-rw-r--r--test/scanners/css/redmine.expected.raydebug2
8 files changed, 423 insertions, 26 deletions
diff --git a/Changes.textile b/Changes.textile
index 6842e10..ac20c94 100644
--- a/Changes.textile
+++ b/Changes.textile
@@ -8,17 +8,18 @@ h2. Changes in 1.0
* *FIXED* some image links in the documentation
* *IMPROVED* Ruby 1.9 support (_._ not in @$LOAD_PATH@)
-h3. @Tokens::AbbreviationForKind@
+h3. *RENAMED*: @Tokens::AbbreviationForKind@
-* *RENAMED* from @ClassOfKind@. The term "token class" is no longer used in CodeRay. Instead, tokens have _kinds_.
- See "#122":http://redmine.rubychan.de/issues/122.
+Renamed from @ClassOfKind@; the term "token class" is no longer used in CodeRay. Instead, tokens have _kinds_.
+See "#122":http://redmine.rubychan.de/issues/122.
+
* *REMOVED* token kinds @:attribute_name_fat@, @:attribute_value_fat@, @:operator_fat@, @:tag_fat@, and @:xml_text@.
* *ADDED* token kinds @:filename@ and @:namespace@.
* *CHANGED*: Don't raise error for unknown token kinds unless in @$CODERAY_DEBUG@ mode.
h3. @Encoders::CommentFilter@
-* *NEW* alias @:remove_comments@.
+* *NEW* alias @:remove_comments@
h3. @Encoders::HTML@
@@ -49,6 +50,13 @@ h3. @Scanners::Scanner@
* *REMOVED* @String#to_unix@.
+h3. @Scanners::CSS@
+
+* *NEW*: Rudimentary support for the @attr@, @counter@, and @counters@ functions.
+ See "#224":http://redmine.rubychan.de/issues/224.
+* *NEW*: Rudimentary support for CSS 3 colors.
+* *CHANGED*: Attribute selectors are highlighted as @:attribute_name@ instead of @:string@.
+
h3. @Scanners::Debug@
* *NEW*: Support for line tokens (@begin_line@ and @end_line@ represented by @[@ and @]@.)
@@ -112,10 +120,10 @@ h3. @Scanners::SQL@
* *IMPROVED*: Extended list of keywords and functions (thanks to Joshua Galvez).
See "#221":http://redmine.rubychan.de/issues/221.
-h3. @Styles::Alpha@
+h3. *NEW*: @Styles::Alpha@
-* *NEW* A style that uses transparent HSLA colors as defined in CSS 3.
- See "#199":http://redmine.rubychan.de/issues/199.
+A style that uses transparent HSLA colors as defined in CSS 3.
+See "#199":http://redmine.rubychan.de/issues/199.
h3. @FileType@
diff --git a/etc/coderay-lib.tmproj b/etc/coderay-lib.tmproj
index db03710..8c3863a 100644
--- a/etc/coderay-lib.tmproj
+++ b/etc/coderay-lib.tmproj
@@ -2,11 +2,11 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
+ <key>currentDocument</key>
+ <string>../lib/coderay/scanners/diff.rb</string>
<key>documents</key>
<array>
<dict>
- <key>expanded</key>
- <true/>
<key>name</key>
<string>lib</string>
<key>regexFolderFilter</key>
@@ -15,6 +15,8 @@
<string>../lib</string>
</dict>
<dict>
+ <key>expanded</key>
+ <true/>
<key>name</key>
<string>bin</string>
<key>regexFolderFilter</key>
@@ -26,19 +28,15 @@
<key>filename</key>
<string>../diff</string>
<key>lastUsed</key>
- <date>2010-04-02T06:59:44Z</date>
- </dict>
- <dict>
- <key>filename</key>
- <string>../lib.diff</string>
- <key>lastUsed</key>
- <date>2010-03-31T19:58:45Z</date>
+ <date>2010-04-11T23:04:37Z</date>
</dict>
<dict>
<key>filename</key>
<string>../Changes.textile</string>
<key>lastUsed</key>
- <date>2010-04-02T06:59:45Z</date>
+ <date>2010-04-11T23:14:08Z</date>
+ <key>selected</key>
+ <true/>
</dict>
<dict>
<key>filename</key>
@@ -134,7 +132,42 @@
<key>fileHierarchyDrawerWidth</key>
<integer>213</integer>
<key>metaData</key>
- <dict/>
+ <dict>
+ <key>../lib/coderay/scanners/diff.rb</key>
+ <dict>
+ <key>caret</key>
+ <dict>
+ <key>column</key>
+ <integer>34</integer>
+ <key>line</key>
+ <integer>38</integer>
+ </dict>
+ <key>columnSelection</key>
+ <false/>
+ <key>firstVisibleColumn</key>
+ <integer>0</integer>
+ <key>firstVisibleLine</key>
+ <integer>17</integer>
+ <key>selectFrom</key>
+ <dict>
+ <key>column</key>
+ <integer>23</integer>
+ <key>line</key>
+ <integer>38</integer>
+ </dict>
+ <key>selectTo</key>
+ <dict>
+ <key>column</key>
+ <integer>34</integer>
+ <key>line</key>
+ <integer>38</integer>
+ </dict>
+ </dict>
+ </dict>
+ <key>openDocuments</key>
+ <array>
+ <string>../lib/coderay/scanners/diff.rb</string>
+ </array>
<key>showFileHierarchyDrawer</key>
<true/>
<key>windowFrame</key>
diff --git a/lib/coderay/scanners/css.rb b/lib/coderay/scanners/css.rb
index 1806d24..75cd056 100644
--- a/lib/coderay/scanners/css.rb
+++ b/lib/coderay/scanners/css.rb
@@ -41,7 +41,7 @@ module Scanners
Dimension = /#{Num}#{Unit}/
Comment = %r! /\* (?: .*? \*/ | .* ) !mx
- Function = /(?:url|alpha)\((?:[^)\n\r\f]|\\\))*\)?/
+ Function = /(?:url|alpha|attr|counters?)\((?:[^)\n\r\f]|\\\))*\)?/
Id = /##{Name}/
Class = /\.#{Name}/
@@ -76,11 +76,9 @@ module Scanners
kind = :pseudo_class
elsif match = scan(RE::AttributeSelector)
# TODO: Improve highlighting inside of attribute selectors.
- tokens << [:open, :string]
- tokens << [match[0,1], :delimiter]
- tokens << [match[1..-2], :content] if match.size > 2
- tokens << [match[-1,1], :delimiter] if match[-1] == ?]
- tokens << [:close, :string]
+ tokens << [match[0,1], :operator]
+ tokens << [match[1..-2], :attribute_name] if match.size > 2
+ tokens << [match[-1,1], :operator] if match[-1] == ?]
next
elsif match = scan(/@media/)
kind = :directive
@@ -171,7 +169,7 @@ module Scanners
elsif scan(/! *important/)
kind = :important
- elsif scan(/rgb\([^()\n]*\)?/)
+ elsif scan(/(?:rgb|hsl)a?\([^()\n]*\)?/)
kind = :color
elsif scan(/#{RE::AtKeyword}/o)
diff --git a/test/scanners/css/coderay.expected.raydebug b/test/scanners/css/coderay.expected.raydebug
new file mode 100644
index 0000000..0841f19
--- /dev/null
+++ b/test/scanners/css/coderay.expected.raydebug
@@ -0,0 +1,124 @@
+class(.CodeRay) class(.line_numbers) type(a)operator(,) class(.CodeRay) class(.no) type(a) operator({)
+ key(text-decoration)operator(:) value(inherit)operator(;)
+ key(color)operator(:) value(inherit)operator(;)
+operator(})
+class(.CodeRay) operator({)
+ key(background-color)operator(:) color(#f8f8f8)operator(;)
+ key(border)operator(:) float(1px) value(solid) value(silver)operator(;)
+ key(font-family)operator(:) string<delimiter(')content(Courier New)delimiter(')>operator(,) string<delimiter(')content(Terminal)delimiter(')>operator(,) value(monospace)operator(;)
+ key(color)operator(:) color(#000)operator(;)
+operator(})
+class(.CodeRay) type(pre) operator({) key(margin)operator(:) float(0px)operator(;) operator(})
+
+type(span)class(.CodeRay) operator({) key(white-space)operator(:) value(pre)operator(;) key(border)operator(:) float(0px)operator(;) key(padding)operator(:) float(2px)operator(;) operator(})
+
+type(table)class(.CodeRay) operator({) key(border-collapse)operator(:) value(collapse)operator(;) key(width)operator(:) float(100%)operator(;) key(padding)operator(:) float(2px)operator(;) operator(})
+type(table)class(.CodeRay) type(td) operator({) key(padding)operator(:) float(2px) float(4px)operator(;) key(vertical-align)operator(:) value(top)operator(;) operator(})
+
+class(.CodeRay) class(.line_numbers)operator(,) class(.CodeRay) class(.no) operator({)
+ key(background-color)operator(:) color(#def)operator(;)
+ key(color)operator(:) value(gray)operator(;)
+ key(text-align)operator(:) value(right)operator(;)
+operator(})
+class(.CodeRay) class(.line_numbers) type(a)pseudo_class(:target)operator(,) class(.CodeRay) class(.no) type(a)pseudo_class(:target) operator({) key(color)operator(:) value(blue)operator(;) operator(})
+class(.CodeRay) class(.line_numbers) class(.highlighted)operator(,) class(.CodeRay) class(.no) class(.highlighted) operator({) key(color)operator(:) value(red)operator(;) operator(})
+class(.CodeRay) class(.no) operator({) key(padding)operator(:) float(0px) float(4px)operator(;) operator(})
+class(.CodeRay) class(.code) operator({) key(width)operator(:) float(100%)operator(;) operator(})
+class(.CodeRay) class(.code) type(pre) operator({) key(overflow)operator(:) value(auto)operator(;) operator(})
+
+class(.CodeRay) class(.debug) operator({) key(color)operator(:)value(white) important(! important)operator(;) key(background)operator(:)value(blue) important(! important)operator(;) operator(})
+
+class(.CodeRay) class(.an) operator({) key(color)operator(:)color(#007) operator(})
+class(.CodeRay) class(.at) operator({) key(color)operator(:)color(#f08) operator(})
+class(.CodeRay) class(.av) operator({) key(color)operator(:)color(#700) operator(})
+class(.CodeRay) class(.bi) operator({) key(color)operator(:)color(#509)operator(;) key(font-weight)operator(:)value(bold) operator(})
+class(.CodeRay) class(.c) operator({) key(color)operator(:)color(#888)operator(;) operator(})
+class(.CodeRay) class(.c) class(.dl) operator({) key(color)operator(:)color(#444)operator(;) operator(})
+class(.CodeRay) class(.c) class(.ch) operator({) key(color)operator(:)color(#444)operator(;) operator(})
+
+class(.CodeRay) class(.ch) operator({) key(color)operator(:)color(#04D) operator(})
+class(.CodeRay) class(.ch) class(.k) operator({) key(color)operator(:)color(#04D) operator(})
+class(.CodeRay) class(.ch) class(.dl) operator({) key(color)operator(:)color(#039) operator(})
+
+class(.CodeRay) class(.cl) operator({) key(color)operator(:)color(#B06)operator(;) key(font-weight)operator(:)value(bold) operator(})
+class(.CodeRay) class(.cm) operator({) key(color)operator(:)color(#A08)operator(;) key(font-weight)operator(:)value(bold) operator(})
+class(.CodeRay) class(.co) operator({) key(color)operator(:)color(#036)operator(;) key(font-weight)operator(:)value(bold) operator(})
+class(.CodeRay) class(.cr) operator({) key(color)operator(:)color(#0A0) operator(})
+class(.CodeRay) class(.cv) operator({) key(color)operator(:)color(#369) operator(})
+class(.CodeRay) class(.de) operator({) key(color)operator(:)color(#B0B)operator(;) operator(})
+class(.CodeRay) class(.df) operator({) key(color)operator(:)color(#099)operator(;) key(font-weight)operator(:)value(bold) operator(})
+class(.CodeRay) class(.di) operator({) key(color)operator(:)color(#088)operator(;) key(font-weight)operator(:)value(bold) operator(})
+class(.CodeRay) class(.dl) operator({) key(color)operator(:)value(black) operator(})
+class(.CodeRay) class(.do) operator({) key(color)operator(:)color(#970) operator(})
+class(.CodeRay) class(.dt) operator({) key(color)operator(:)color(#34b) operator(})
+class(.CodeRay) class(.ds) operator({) key(color)operator(:)color(#D42)operator(;) key(font-weight)operator(:)value(bold) operator(})
+class(.CodeRay) class(.e) operator({) key(color)operator(:)color(#666)operator(;) key(font-weight)operator(:)value(bold) operator(})
+class(.CodeRay) class(.en) operator({) key(color)operator(:)color(#800)operator(;) key(font-weight)operator(:)value(bold) operator(})
+class(.CodeRay) class(.er) operator({) key(color)operator(:)color(#F00)operator(;) key(background-color)operator(:)color(#FAA) operator(})
+class(.CodeRay) class(.ex) operator({) key(color)operator(:)color(#C00)operator(;) key(font-weight)operator(:)value(bold) operator(})
+class(.CodeRay) class(.fl) operator({) key(color)operator(:)color(#60E)operator(;) key(font-weight)operator(:)value(bold) operator(})
+class(.CodeRay) class(.fu) operator({) key(color)operator(:)color(#06B)operator(;) key(font-weight)operator(:)value(bold) operator(})
+class(.CodeRay) class(.gv) operator({) key(color)operator(:)color(#d70)operator(;) key(font-weight)operator(:)value(bold) operator(})
+class(.CodeRay) class(.hx) operator({) key(color)operator(:)color(#058)operator(;) key(font-weight)operator(:)value(bold) operator(})
+class(.CodeRay) class(.i) operator({) key(color)operator(:)color(#00D)operator(;) key(font-weight)operator(:)value(bold) operator(})
+class(.CodeRay) class(.ic) operator({) key(color)operator(:)color(#B44)operator(;) key(font-weight)operator(:)value(bold) operator(})
+
+class(.CodeRay) class(.il) operator({) key(background-color)operator(:) color(hsla(0,0%,0%,0.1\))operator(;) key(color)operator(:) value(black) operator(})
+class(.CodeRay) class(.il) class(.idl) operator({) key(font-weight)operator(:) value(bold)operator(;) key(color)operator(:) color(#666) operator(})
+class(.CodeRay) class(.idl) operator({) key(font-weight)operator(:) value(bold)operator(;) key(color)operator(:) color(#666)operator(;) operator(})
+
+class(.CodeRay) class(.im) operator({) key(color)operator(:)color(#f00)operator(;) operator(})
+class(.CodeRay) class(.in) operator({) key(color)operator(:)color(#B2B)operator(;) key(font-weight)operator(:)value(bold) operator(})
+class(.CodeRay) class(.iv) operator({) key(color)operator(:)color(#33B) operator(})
+class(.CodeRay) class(.la) operator({) key(color)operator(:)color(#970)operator(;) key(font-weight)operator(:)value(bold) operator(})
+class(.CodeRay) class(.lv) operator({) key(color)operator(:)color(#963) operator(})
+class(.CodeRay) class(.ns) operator({) key(color)operator(:)color(#707)operator(;) key(font-weight)operator(:)value(bold) operator(})
+class(.CodeRay) class(.oc) operator({) key(color)operator(:)color(#40E)operator(;) key(font-weight)operator(:)value(bold) operator(})
+class(.CodeRay) class(.op) operator({) operator(})
+class(.CodeRay) class(.pc) operator({) key(color)operator(:)color(#058)operator(;) key(font-weight)operator(:)value(bold) operator(})
+class(.CodeRay) class(.pd) operator({) key(color)operator(:)color(#369)operator(;) key(font-weight)operator(:)value(bold) operator(})
+class(.CodeRay) class(.pp) operator({) key(color)operator(:)color(#579)operator(;) operator(})
+class(.CodeRay) class(.ps) operator({) key(color)operator(:)color(#00C)operator(;) key(font-weight)operator(:)value(bold) operator(})
+class(.CodeRay) class(.pt) operator({) key(color)operator(:)color(#074)operator(;) key(font-weight)operator(:)value(bold) operator(})
+class(.CodeRay) class(.r)operator(,) class(.kw) operator({) key(color)operator(:)color(#080)operator(;) key(font-weight)operator(:)value(bold) operator(})
+
+class(.CodeRay) class(.ke) operator({) key(color)operator(:) color(#808)operator(;) operator(})
+class(.CodeRay) class(.ke) class(.dl) operator({) key(color)operator(:) color(#606)operator(;) operator(})
+class(.CodeRay) class(.ke) class(.ch) operator({) key(color)operator(:) color(#80f)operator(;) operator(})
+class(.CodeRay) class(.vl) operator({) key(color)operator(:) color(#088)operator(;) operator(})
+
+class(.CodeRay) class(.rx) operator({) key(background-color)operator(:)color(hsla(300,100%,50%,0.1\))operator(;) key(color)operator(:)color(#808) operator(})
+class(.CodeRay) class(.rx) class(.k) operator({) operator(})
+class(.CodeRay) class(.rx) class(.dl) operator({) key(color)operator(:)color(#404) operator(})
+class(.CodeRay) class(.rx) class(.mod) operator({) key(color)operator(:)color(#C2C) operator(})
+class(.CodeRay) class(.rx) class(.fu) operator({) key(color)operator(:)color(#404)operator(;) key(font-weight)operator(:) value(bold) operator(})
+
+class(.CodeRay) class(.s) operator({) key(background-color)operator(:)color(hsla(0,100%,50%,0.1\))operator(;) key(color)operator(:) color(#D20)operator(;) operator(})
+class(.CodeRay) class(.s) class(.k) operator({) operator(})
+class(.CodeRay) class(.s) class(.ch) operator({) key(color)operator(:) color(#b0b)operator(;) operator(})
+class(.CodeRay) class(.s) class(.dl) operator({) key(color)operator(:) color(#710)operator(;) operator(})
+
+class(.CodeRay) class(.sh) operator({) key(background-color)operator(:)color(hsla(120,100%,50%,0.1\))operator(;) key(color)operator(:)color(#2B2) operator(})
+class(.CodeRay) class(.sh) class(.k) operator({) operator(})
+class(.CodeRay) class(.sh) class(.dl) operator({) key(color)operator(:)color(#161) operator(})
+
+class(.CodeRay) class(.sy) operator({) key(color)operator(:)color(#A60) operator(})
+class(.CodeRay) class(.sy) class(.k) operator({) key(color)operator(:)color(#A60) operator(})
+class(.CodeRay) class(.sy) class(.dl) operator({) key(color)operator(:)color(#630) operator(})
+
+class(.CodeRay) class(.ta) operator({) key(color)operator(:)color(#070) operator(})
+class(.CodeRay) class(.ts) operator({) key(color)operator(:)color(#D70)operator(;) key(font-weight)operator(:)value(bold) operator(})
+class(.CodeRay) class(.ty) operator({) key(color)operator(:)color(#339)operator(;) key(font-weight)operator(:)value(bold) operator(})
+class(.CodeRay) class(.v) operator({) key(color)operator(:)color(#036) operator(})
+class(.CodeRay) class(.xt) operator({) key(color)operator(:)color(#444) operator(})
+
+class(.CodeRay) class(.ins) operator({) key(background)operator(:) color(#afa)operator(;) operator(})
+class(.CodeRay) class(.del) operator({) key(background)operator(:) color(#faa)operator(;) operator(})
+class(.CodeRay) class(.chg) operator({) key(color)operator(:) color(#aaf)operator(;) key(background)operator(:) color(#007)operator(;) operator(})
+class(.CodeRay) class(.head) operator({) key(color)operator(:) color(#f8f)operator(;) key(background)operator(:) color(#505) operator(})
+class(.CodeRay) class(.head) class(.filename) operator({) key(color)operator(:) value(white)operator(;) operator(})
+
+class(.CodeRay) class(.ins) class(.ins) operator({) key(color)operator(:) color(#080)operator(;) key(font-weight)operator(:)value(bold) operator(})
+class(.CodeRay) class(.del) class(.del) operator({) key(color)operator(:) color(#800)operator(;) key(font-weight)operator(:)value(bold) operator(})
+class(.CodeRay) class(.chg) class(.chg) operator({) key(color)operator(:) color(#66f)operator(;) operator(})
+class(.CodeRay) class(.head) class(.head) operator({) key(color)operator(:) color(#f4f)operator(;) operator(})
diff --git a/test/scanners/css/coderay.in.css b/test/scanners/css/coderay.in.css
new file mode 100644
index 0000000..ccb5d4a
--- /dev/null
+++ b/test/scanners/css/coderay.in.css
@@ -0,0 +1,124 @@
+.CodeRay .line_numbers a, .CodeRay .no a {
+ text-decoration: inherit;
+ color: inherit;
+}
+.CodeRay {
+ background-color: #f8f8f8;
+ border: 1px solid silver;
+ font-family: 'Courier New', 'Terminal', monospace;
+ color: #000;
+}
+.CodeRay pre { margin: 0px; }
+
+span.CodeRay { white-space: pre; border: 0px; padding: 2px; }
+
+table.CodeRay { border-collapse: collapse; width: 100%; padding: 2px; }
+table.CodeRay td { padding: 2px 4px; vertical-align: top; }
+
+.CodeRay .line_numbers, .CodeRay .no {
+ background-color: #def;
+ color: gray;
+ text-align: right;
+}
+.CodeRay .line_numbers a:target, .CodeRay .no a:target { color: blue; }
+.CodeRay .line_numbers .highlighted, .CodeRay .no .highlighted { color: red; }
+.CodeRay .no { padding: 0px 4px; }
+.CodeRay .code { width: 100%; }
+.CodeRay .code pre { overflow: auto; }
+
+.CodeRay .debug { color:white ! important; background:blue ! important; }
+
+.CodeRay .an { color:#007 }
+.CodeRay .at { color:#f08 }
+.CodeRay .av { color:#700 }
+.CodeRay .bi { color:#509; font-weight:bold }
+.CodeRay .c { color:#888; }
+.CodeRay .c .dl { color:#444; }
+.CodeRay .c .ch { color:#444; }
+
+.CodeRay .ch { color:#04D }
+.CodeRay .ch .k { color:#04D }
+.CodeRay .ch .dl { color:#039 }
+
+.CodeRay .cl { color:#B06; font-weight:bold }
+.CodeRay .cm { color:#A08; font-weight:bold }
+.CodeRay .co { color:#036; font-weight:bold }
+.CodeRay .cr { color:#0A0 }
+.CodeRay .cv { color:#369 }
+.CodeRay .de { color:#B0B; }
+.CodeRay .df { color:#099; font-weight:bold }
+.CodeRay .di { color:#088; font-weight:bold }
+.CodeRay .dl { color:black }
+.CodeRay .do { color:#970 }
+.CodeRay .dt { color:#34b }
+.CodeRay .ds { color:#D42; font-weight:bold }
+.CodeRay .e { color:#666; font-weight:bold }
+.CodeRay .en { color:#800; font-weight:bold }
+.CodeRay .er { color:#F00; background-color:#FAA }
+.CodeRay .ex { color:#C00; font-weight:bold }
+.CodeRay .fl { color:#60E; font-weight:bold }
+.CodeRay .fu { color:#06B; font-weight:bold }
+.CodeRay .gv { color:#d70; font-weight:bold }
+.CodeRay .hx { color:#058; font-weight:bold }
+.CodeRay .i { color:#00D; font-weight:bold }
+.CodeRay .ic { color:#B44; font-weight:bold }
+
+.CodeRay .il { background-color: hsla(0,0%,0%,0.1); color: black }
+.CodeRay .il .idl { font-weight: bold; color: #666 }
+.CodeRay .idl { font-weight: bold; color: #666; }
+
+.CodeRay .im { color:#f00; }
+.CodeRay .in { color:#B2B; font-weight:bold }
+.CodeRay .iv { color:#33B }
+.CodeRay .la { color:#970; font-weight:bold }
+.CodeRay .lv { color:#963 }
+.CodeRay .ns { color:#707; font-weight:bold }
+.CodeRay .oc { color:#40E; font-weight:bold }
+.CodeRay .op { }
+.CodeRay .pc { color:#058; font-weight:bold }
+.CodeRay .pd { color:#369; font-weight:bold }
+.CodeRay .pp { color:#579; }
+.CodeRay .ps { color:#00C; font-weight:bold }
+.CodeRay .pt { color:#074; font-weight:bold }
+.CodeRay .r, .kw { color:#080; font-weight:bold }
+
+.CodeRay .ke { color: #808; }
+.CodeRay .ke .dl { color: #606; }
+.CodeRay .ke .ch { color: #80f; }
+.CodeRay .vl { color: #088; }
+
+.CodeRay .rx { background-color:hsla(300,100%,50%,0.1); color:#808 }
+.CodeRay .rx .k { }
+.CodeRay .rx .dl { color:#404 }
+.CodeRay .rx .mod { color:#C2C }
+.CodeRay .rx .fu { color:#404; font-weight: bold }
+
+.CodeRay .s { background-color:hsla(0,100%,50%,0.1); color: #D20; }
+.CodeRay .s .k { }
+.CodeRay .s .ch { color: #b0b; }
+.CodeRay .s .dl { color: #710; }
+
+.CodeRay .sh { background-color:hsla(120,100%,50%,0.1); color:#2B2 }
+.CodeRay .sh .k { }
+.CodeRay .sh .dl { color:#161 }
+
+.CodeRay .sy { color:#A60 }
+.CodeRay .sy .k { color:#A60 }
+.CodeRay .sy .dl { color:#630 }
+
+.CodeRay .ta { color:#070 }
+.CodeRay .ts { color:#D70; font-weight:bold }
+.CodeRay .ty { color:#339; font-weight:bold }
+.CodeRay .v { color:#036 }
+.CodeRay .xt { color:#444 }
+
+.CodeRay .ins { background: #afa; }
+.CodeRay .del { background: #faa; }
+.CodeRay .chg { color: #aaf; background: #007; }
+.CodeRay .head { color: #f8f; background: #505 }
+.CodeRay .head .filename { color: white; }
+
+.CodeRay .ins .ins { color: #080; font-weight:bold }
+.CodeRay .del .del { color: #800; font-weight:bold }
+.CodeRay .chg .chg { color: #66f; }
+.CodeRay .head .head { color: #f4f; }
diff --git a/test/scanners/css/demo.expected.raydebug b/test/scanners/css/demo.expected.raydebug
new file mode 100644
index 0000000..4786176
--- /dev/null
+++ b/test/scanners/css/demo.expected.raydebug
@@ -0,0 +1,55 @@
+comment(/*) comment(See) comment(http://reference.sitepoint.com/css/content.) comment(*/)
+directive(@media) type(print) operator({)
+ type(a)operator([)attribute_name(href)operator(])pseudo_class(:after) operator({)
+ key(content)operator(:) string<delimiter(")content(<)delimiter(")> string<delimiter(attr()content(href)delimiter(\))> string<delimiter(")content(>)delimiter(")>operator(;)
+ operator(})
+operator(})
+
+type(a)pseudo_class(:link)pseudo_class(:after)operator(,) type(a)pseudo_class(:visited)pseudo_class(:after) operator({)key(content)operator(:)string<delimiter(")content( ()delimiter(")> string<delimiter(attr()content(href)delimiter(\))> string<delimiter(")content(\))delimiter(")>operator(;)key(font-size)operator(:)float(90%)operator(;)operator(})
+type(ol) operator({)
+ key(counter-reset)operator(:) value(item)operator(;)
+ key(margin)operator(:) float(0)operator(;)
+ key(padding)operator(:) float(0)operator(;)
+operator(})
+type(ol)operator(>)type(li) operator({)
+ key(counter-increment)operator(:) value(item)operator(;)
+ key(list-style)operator(:) value(none) value(inside)operator(;)
+operator(})
+type(ol)operator(>)type(li)pseudo_class(:before) operator({)
+ key(content)operator(:) string<delimiter(counters()content(item, ".")delimiter(\))> string<delimiter(")content( - )delimiter(")>operator(;)
+operator(})
+
+type(body) operator({)
+ key(counter-reset)operator(:) value(chapter)operator(;)
+operator(})
+type(h1) operator({)
+ key(counter-increment)operator(:) value(chapter)operator(;)
+ key(counter-reset)operator(:) value(section)operator(;)
+operator(})
+type(h2) operator({)
+ key(counter-increment)operator(:) value(section)operator(;)
+operator(})
+type(h1)pseudo_class(:before) operator({)
+ key(content)operator(:) string<delimiter(")content(Chapter )delimiter(")> string<delimiter(counter()content(chapter)delimiter(\))> string<delimiter(")content(: )delimiter(")>operator(;)
+operator(})
+type(h2)pseudo_class(:before) operator({)
+ key(content)operator(:) string<delimiter(counter()content(chapter)delimiter(\))> string<delimiter(")content(.)delimiter(")> string<delimiter(counter()content(section)delimiter(\))> string<delimiter(")content( )delimiter(")>operator(;)
+operator(})
+
+type(blockquote) type(p) operator({)
+ key(margin)operator(:) float(0)operator(;)
+ key(text-indent)operator(:) float(1em)operator(;)
+ key(quotes)operator(:) string<delimiter(")content(\\201c)delimiter(")> string<delimiter(")content(\\201d)delimiter(")>operator(;)
+operator(})
+type(blockquote) type(p)pseudo_class(:first-of-type) operator({)
+ key(text-indent)operator(:) float(0)operator(;)
+operator(})
+type(blockquote) type(p)operator(:)pseudo_class(:before) operator({)
+ key(content)operator(:) value(open-quote)operator(;)
+operator(})
+type(blockquote) type(p)operator(:)pseudo_class(:after) operator({)
+ key(content)operator(:) value(no-close-quote)operator(;)
+operator(})
+type(blockquote) type(p)pseudo_class(:last-of-type)operator(:)pseudo_class(:after) operator({)
+ key(content)operator(:) value(close-quote)operator(;)
+operator(}) \ No newline at end of file
diff --git a/test/scanners/css/demo.in.css b/test/scanners/css/demo.in.css
new file mode 100644
index 0000000..3b3b133
--- /dev/null
+++ b/test/scanners/css/demo.in.css
@@ -0,0 +1,55 @@
+/* See http://reference.sitepoint.com/css/content. */
+@media print {
+ a[href]:after {
+ content: "<" attr(href) ">";
+ }
+}
+
+a:link:after, a:visited:after {content:" (" attr(href) ")";font-size:90%;}
+ol {
+ counter-reset: item;
+ margin: 0;
+ padding: 0;
+}
+ol>li {
+ counter-increment: item;
+ list-style: none inside;
+}
+ol>li:before {
+ content: counters(item, ".") " - ";
+}
+
+body {
+ counter-reset: chapter;
+}
+h1 {
+ counter-increment: chapter;
+ counter-reset: section;
+}
+h2 {
+ counter-increment: section;
+}
+h1:before {
+ content: "Chapter " counter(chapter) ": ";
+}
+h2:before {
+ content: counter(chapter) "." counter(section) " ";
+}
+
+blockquote p {
+ margin: 0;
+ text-indent: 1em;
+ quotes: "\201c" "\201d";
+}
+blockquote p:first-of-type {
+ text-indent: 0;
+}
+blockquote p::before {
+ content: open-quote;
+}
+blockquote p::after {
+ content: no-close-quote;
+}
+blockquote p:last-of-type::after {
+ content: close-quote;
+} \ No newline at end of file
diff --git a/test/scanners/css/redmine.expected.raydebug b/test/scanners/css/redmine.expected.raydebug
index cf59a30..c5a9415 100644
--- a/test/scanners/css/redmine.expected.raydebug
+++ b/test/scanners/css/redmine.expected.raydebug
@@ -281,7 +281,7 @@ class(.tabular)class(.settings) type(label)operator({) key(margin-left)operator(
class(.required) operator({)key(color)operator(:) color(#bb0000)operator(;)operator(})
class(.summary) operator({)key(font-style)operator(:) value(italic)operator(;)operator(})
-constant(#attachments_fields) type(input)string<delimiter([)content(type=text)delimiter(])> operator({)key(margin-left)operator(:) float(8px)operator(;) operator(})
+constant(#attachments_fields) type(input)operator([)attribute_name(type=text)operator(]) operator({)key(margin-left)operator(:) float(8px)operator(;) operator(})
type(div)class(.attachments) operator({) key(margin-top)operator(:) float(12px)operator(;) operator(})
type(div)class(.attachments) type(p) operator({) key(margin)operator(:)float(4px) float(0) float(2px) float(0)operator(;) operator(})