diff --git a/lib/sass/gem_package_importer.rb b/lib/sass/gem_package_importer.rb index fc27f0fd..11a25149 100644 --- a/lib/sass/gem_package_importer.rb +++ b/lib/sass/gem_package_importer.rb @@ -9,8 +9,9 @@ def find_file_url(url, _canonicalize_context) library, _, path = url[4..].partition(/[?#]/).first.partition('/') gem_dir = Gem::Dependency.new(library).to_spec.gem_dir + gem_dir = "/#{gem_dir}" unless gem_dir.start_with?('/') - "file://#{'/' unless gem_dir.start_with?('/')}#{gem_dir.gsub(/[?#]/, { '?' => '%3F', '#' => '%23' })}/#{path}" + "file://#{gem_dir.gsub(/[?#%]/, { '?' => '%3F', '#' => '%23', '%' => '%25' })}/#{path}" rescue Gem::MissingSpecError nil end