Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Properly handle escaped tabs (#95)

Closes #94
  • Loading branch information...
nex3 committed Nov 7, 2018
1 parent 6f35128 commit b2b80e05c3062a7797519d9e6440b2466502cb2d
Showing with 7 additions and 1 deletion.
  1. +4 −0 doc-src/SASS_CHANGELOG.md
  2. +2 −0 lib/sass/scss/parser.rb
  3. +1 −1 lib/sass/scss/rx.rb
@@ -3,6 +3,10 @@
* Table of contents
{:toc}

## 3.7.1 (Unreleased)

* Properly handle escaped whitespace and other unusual characters.

## 3.7.0 (6 November 2018)

* Add support for CSS's `min()` and `max()` [math functions][]. A `min()` and
@@ -991,6 +991,8 @@ def value!
# containing the value.
# This results in a dramatic speed increase.
if (val = tok(STATIC_VALUE))
# If val ends with escaped whitespace, leave it be.
val = val.lstrip.sub(/(?<!\\)\s*$/, '\1')
str = Sass::Script::Tree::Literal.new(Sass::Script::Value::String.new(val.strip))
str.line = start_pos.line
str.source_range = range(start_pos)
@@ -52,7 +52,7 @@ def self.quote(str, flags = 0)
UNICODE = /\\#{H}{1,6}[ \t\r\n\f]?/
s = '\u{80}-\u{D7FF}\u{E000}-\u{FFFD}\u{10000}-\u{10FFFF}'
NONASCII = /[#{s}]/
ESCAPE = /#{UNICODE}|\\[ -~#{s}]/
ESCAPE = /#{UNICODE}|\\[^0-9a-fA-F\r\n\f]/
NMSTART = /[_a-zA-Z]|#{NONASCII}|#{ESCAPE}/
NMCHAR = /[a-zA-Z0-9_-]|#{NONASCII}|#{ESCAPE}/
STRING1 = /\"((?:[^\n\r\f\\"]|\\#{NL}|#{ESCAPE})*)\"/

0 comments on commit b2b80e0

Please sign in to comment.
You can’t perform that action at this time.