Skip to content

Commit 5bea8e3

Browse files
committed
don't nest :string recursively in :sass_inline
1 parent 8563acc commit 5bea8e3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/coderay/scanners/sass.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,14 @@ def scan_tokens encoder, options
139139
encoder.begin_group :string
140140
string_delimiter = match
141141
encoder.text_token match, :delimiter
142-
states.push :string
142+
if states.include? :sass_inline
143+
content = scan_until(/(?=#{string_delimiter}|\}|\z)/)
144+
encoder.text_token content, :content unless content.empty?
145+
encoder.text_token string_delimiter, :delimiter if scan(/#{string_delimiter}/)
146+
encoder.end_group :string
147+
else
148+
states.push :string
149+
end
143150

144151
elsif match = scan(/#{SASS_FUNCTION}/o)
145152
encoder.text_token match, :predefined

0 commit comments

Comments
 (0)