Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap-sass.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tasks
diff options
context:
space:
mode:
authorGleb Mazovetskiy <glebm@google.com>2015-01-15 01:44:21 +0300
committerGleb Mazovetskiy <glebm@google.com>2015-01-18 01:49:15 +0300
commit443d5b49eac84aec1cb2f8ea173554327bfc8c14 (patch)
treed0575134f258da683cd1a17e6d48584ee250addd /tasks
parentbcf9fcd38b9f77cb0117c9048c24d9bb9e88a09d (diff)
Fix #803 by unquoting all UTF8 escapes
Work around Sass 3.4.x generating BOM that break IE10+ https://github.com/sass/sass/issues/1395
Diffstat (limited to 'tasks')
-rw-r--r--tasks/converter/less_conversion.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/tasks/converter/less_conversion.rb b/tasks/converter/less_conversion.rb
index ad668905..b530be47 100644
--- a/tasks/converter/less_conversion.rb
+++ b/tasks/converter/less_conversion.rb
@@ -170,6 +170,7 @@ class Converter
file = deinterpolate_vararg_mixins(file)
file = replace_calculation_semantics(file)
file = replace_file_imports(file)
+ file = unquote_utf8_escape_sequences(file)
file
end
@@ -314,6 +315,12 @@ SASS
%Q(@import "#{target_path}\\1";)
end
+ # Unquote escape sequences, e.g. content: "#{$sep}\00a0" to content: #{$sep}\00a0
+ # Works around Sass 3.4 issue: https://github.com/sass/sass/issues/1395
+ def unquote_utf8_escape_sequences(scss)
+ scss.gsub /\"((?:#\{[^}]+\})?\\[a-f0-9]{4,}?)\"/, '\1'
+ end
+
def replace_all(file, regex, replacement = nil, &block)
log_transform regex, replacement
new_file = file.gsub(regex, replacement, &block)