summaryrefslogtreecommitdiff
path: root/vendor/bundle/ruby/3.4.0/gems/sass-embedded-1.89.2-arm64-darwin/lib/sass/serializer.rb
diff options
context:
space:
mode:
authorBenjamin Sanders <ben@Benjamins-MacBook-Pro.local>2025-10-11 10:34:24 -0400
committerBenjamin Sanders <ben@Benjamins-MacBook-Pro.local>2025-10-11 10:34:24 -0400
commit5571dc766e2143e39762ff0b47c41d1c2e154f4c (patch)
treef4f124d314a7e76c04484515aa0fd1f2e271a601 /vendor/bundle/ruby/3.4.0/gems/sass-embedded-1.89.2-arm64-darwin/lib/sass/serializer.rb
parent359f3309c97fc894b63e0a295c76ab298504d635 (diff)
Vendor bundled gems for deployment
Diffstat (limited to 'vendor/bundle/ruby/3.4.0/gems/sass-embedded-1.89.2-arm64-darwin/lib/sass/serializer.rb')
-rw-r--r--vendor/bundle/ruby/3.4.0/gems/sass-embedded-1.89.2-arm64-darwin/lib/sass/serializer.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/vendor/bundle/ruby/3.4.0/gems/sass-embedded-1.89.2-arm64-darwin/lib/sass/serializer.rb b/vendor/bundle/ruby/3.4.0/gems/sass-embedded-1.89.2-arm64-darwin/lib/sass/serializer.rb
new file mode 100644
index 0000000..6a3bc98
--- /dev/null
+++ b/vendor/bundle/ruby/3.4.0/gems/sass-embedded-1.89.2-arm64-darwin/lib/sass/serializer.rb
@@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+module Sass
+ # The {Serializer} module.
+ module Serializer
+ module_function
+
+ CSS_ESCAPE = [*"\x01".."\x08", *"\x0A".."\x1F", "\x7F"]
+ .product([*'0'..'9', *'a'..'f', *'A'..'F', "\t", ' ', nil])
+ .each_with_object({ "\0" => "\uFFFD", '\\' => '\\\\', '"' => '\\"', "'" => "\\'" }) do |(c, x), h|
+ h["#{c}#{x}".freeze] = "\\#{c.ord.to_s(16)}#{" #{x}" if x}".freeze
+ end.freeze
+
+ private_constant :CSS_ESCAPE
+
+ def serialize_quoted_string(string)
+ if !string.include?('"') || string.include?("'")
+ %("#{string.gsub(/[\0\\"]|[\x01-\x08\x0A-\x1F\x7F][\h\t ]?/, CSS_ESCAPE)}")
+ else
+ %('#{string.gsub(/[\0\\']|[\x01-\x08\x0A-\x1F\x7F][\h\t ]?/, CSS_ESCAPE)}')
+ end
+ end
+
+ def serialize_unquoted_string(string)
+ string.tr("\0", "\uFFFD").gsub(/\n */, ' ')
+ end
+ end
+
+ private_constant :Serializer
+end