Skip to content

Commit 1952ef4

Browse files
committed
two fixes for CSS scanner
1 parent 57ffbc7 commit 1952ef4

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Changes.textile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ h2. Changes in 1.1
66

77
* Diff scanner: Highlight inline changes in multi-line changes [#99]
88
* Remove double-click toggle handler from HTML table output
9+
* Fixes to CSS scanner (floats, pseudoclasses)
910
* Display line numbers in HTML @:table@ mode even for single-line code (remove special case) [#41, thanks to Ariejan de Vroom]
1011
* @CodeRay::TokenKinds@ should not be frozen [#130, thanks to Gavin Kistner]
1112

lib/coderay/scanners/css.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module RE # :nodoc:
2727
HexColor = /#(?:#{Hex}{6}|#{Hex}{3})/
2828
Color = /#{HexColor}/
2929

30-
Num = /-?(?:[0-9]+|[0-9]*\.[0-9]+)/
30+
Num = /-?(?:[0-9]+(?!\.\d)|[0-9]*\.[0-9]+)/
3131
Name = /#{NMChar}+/
3232
Ident = /-?#{NMStart}#{NMChar}*/
3333
AtKeyword = /@#{Ident}/
@@ -44,7 +44,7 @@ module RE # :nodoc:
4444

4545
Id = /##{Name}/
4646
Class = /\.#{Name}/
47-
PseudoClass = /:#{Name}/
47+
PseudoClass = /::?#{Name}/
4848
AttributeSelector = /\[[^\]]*\]?/
4949
end
5050

0 commit comments

Comments
 (0)