Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a MacRuby-friendly regex syntax #432

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/sass/scss/rx.rb
Expand Up @@ -51,6 +51,8 @@ def self.quote(str, flags = 0)
UNICODE = /\\#{H}{1,6}[ \t\r\n\f]?/
s = if Sass::Util.ruby1_8?
'\200-\377'
elsif Sass::Util.macruby?
'\u0080-\uD7FF\uE000-\uFFFD\U00010000-\U0010FFFF'
else
'\u{80}-\u{D7FF}\u{E000}-\u{FFFD}\u{10000}-\u{10FFFF}'
end
Expand Down
7 changes: 7 additions & 0 deletions lib/sass/util.rb
Expand Up @@ -465,6 +465,13 @@ def ruby1_8?
def ruby1_8_6?
ruby1_8? && Sass::Util::RUBY_VERSION[2] < 7
end

# Whether or not this is running under MacRuby.
#
# @return [Boolean]
def macruby?
RUBY_ENGINE == 'macruby'
end

# Checks that the encoding of a string is valid in Ruby 1.9
# and cleans up potential encoding gotchas like the UTF-8 BOM.
Expand Down