class Sass::Script::StringInterpolation
def to_sass(opts = {})
- See: Node#to_sass -
def to_sass(opts = {}) # We can get rid of all of this when we remove the deprecated :equals context before_unquote, before_quote_char, before_str = parse_str(@before.to_sass(opts)) after_unquote, after_quote_char, after_str = parse_str(@after.to_sass(opts)) unquote = before_unquote || after_unquote || (before_quote_char && !after_quote_char && !after_str.empty?) || (!before_quote_char && after_quote_char && !before_str.empty?) quote_char = if before_quote_char && after_quote_char && before_quote_char != after_quote_char before_str.gsub!("\\'", "'") before_str.gsub!('"', "\\\"") after_str.gsub!("\\'", "'") after_str.gsub!('"', "\\\"") '"' else before_quote_char || after_quote_char end res = "" res << 'unquote(' if unquote res << quote_char if quote_char res << before_str res << '#{' << @mid.to_sass(opts) << '}' res << after_str res << quote_char if quote_char res << ')' if unquote res end