8000 Scss scanner by Piderman · Pull Request #162 · rubychan/coderay · GitHub
[go: up one dir, main page]

Skip to content

Scss scanner #162

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
nested class selectors
  • Loading branch information
Piderman committed Feb 8, 2014
commit 1041c84e3fc0ef2057c7867d411ac4f49d513306
10 changes: 9 additions & 1 deletion lib/coderay/scanners/scss.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,20 @@ def scan_tokens encoder, options
end

when :block
if match = scan(/(?>#{RE::Ident})(?!\()/ox)
# check for nested selectors class or element
if match = scan(/(\.|\%)[-_a-zA-Z0-9]+/)
encoder.text_token match, :class
next
# TODO: test for tag
# assume standard block now
elsif match = scan(/(?>#{RE::Ident})(?!\()/ox)
if value_expected
encoder.text_token match, :value
else
encoder.text_token match, :key
end


next
end

Expand Down
0