Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/sass/gem_package_importer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down