Add ability to append stuffs after font urls

This commit is contained in:
Maxime Thirouin 2012-03-13 21:53:03 +01:00
parent 8fa1e8b97b
commit b8321a4db0

View File

@ -5,7 +5,8 @@ module Compass::SassExtensions::Functions::FontFiles
:opentype => 'opentype', :opentype => 'opentype',
:ttf => 'truetype', :ttf => 'truetype',
:truetype => 'truetype', :truetype => 'truetype',
:svg => 'svg' :svg => 'svg',
:eot => 'embedded-opentype'
} }
def font_files(*args) def font_files(*args)
@ -24,7 +25,8 @@ module Compass::SassExtensions::Functions::FontFiles
if FONT_TYPES.key? type if FONT_TYPES.key? type
skip_next = true skip_next = true
else else
type = arg.to_s.split('.').last.gsub('"', '').to_sym # let pass url like font.type?thing#stuff
type = arg.to_s.split('.').last.gsub(/(\?(.*))?(#(.*))?"/, '').to_sym
end end
if FONT_TYPES.key? type if FONT_TYPES.key? type