From e144d87be7f7bbfa45aaa5cf086eea0588c233b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Sat, 25 Oct 2025 09:01:04 -0700 Subject: [PATCH] Escape % in Sass::GemPackageImporter --- lib/sass/gem_package_importer.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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