Skip to content

Commit 1041c84

Browse files
committed
nested class selectors
1 parent 00509ec commit 1041c84

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/coderay/scanners/scss.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,20 @@ def scan_tokens encoder, options
7979
end
8080

8181
when :block
82-
if match = scan(/(?>#{RE::Ident})(?!\()/ox)
82+
# check for nested selectors class or element
83+
if match = scan(/(\.|\%)[-_a-zA-Z0-9]+/)
84+
encoder.text_token match, :class
85+
next
86+
# TODO: test for tag
87+
# assume standard block now
88+
elsif match = scan(/(?>#{RE::Ident})(?!\()/ox)
8389
if value_expected
8490
encoder.text_token match, :value
8591
else
8692
encoder.text_token match, :key
8793
end
94+
95+
8896
next
8997
end
9098

0 commit comments

Comments
 (0)