From 81536633863556472b75927cabfe1ccb32ba794c 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 08:07:25 -0700 Subject: [PATCH] Handle ? and # in Sass::GemPackageImporter --- lib/sass/gem_package_importer.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sass/gem_package_importer.rb b/lib/sass/gem_package_importer.rb index b0b0eee2..fc27f0fd 100644 --- a/lib/sass/gem_package_importer.rb +++ b/lib/sass/gem_package_importer.rb @@ -7,10 +7,10 @@ class GemPackageImporter def find_file_url(url, _canonicalize_context) return unless url.start_with?('pkg:') - library, _, path = url[4..].partition('/') + library, _, path = url[4..].partition(/[?#]/).first.partition('/') gem_dir = Gem::Dependency.new(library).to_spec.gem_dir - "file://#{'/' unless gem_dir.start_with?('/')}#{gem_dir}/#{path}" + "file://#{'/' unless gem_dir.start_with?('/')}#{gem_dir.gsub(/[?#]/, { '?' => '%3F', '#' => '%23' })}/#{path}" rescue Gem::MissingSpecError nil end