Skip to content

Commit 73979ff

Browse files
committed
Merge pull request #1111 from xzyfer/fix/ie-hack-regression
Fixes a regression in handling common IE property hacks
2 parents a140623 + 925220c commit 73979ff

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

parser.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1396,7 +1396,8 @@ namespace Sass {
13961396
Token str(lexed);
13971397
--str.end;
13981398
--position;
1399-
String_Constant* str_node = new (ctx.mem) String_Constant(pstate, str);
1399+
1400+
String_Constant* str_node = new (ctx.mem) String_Constant(pstate, str.time_wspace());
14001401
// str_node->is_delayed(true);
14011402
return str_node;
14021403
}

position.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ namespace Sass {
8989
size_t length() const { return end - begin; }
9090
string ws_before() const { return string(prefix, begin); }
9191
string to_string() const { return string(begin, end); }
92+
string time_wspace() const {
93+
string str(to_string());
94+
string whitespaces(" \t\f\v\n\r");
95+
return str.erase(str.find_last_not_of(whitespaces)+1);
96+
}
9297

9398
operator bool() { return begin && end && begin >= end; }
9499
operator string() { return to_string(); }

prelexer.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,10 @@ namespace Sass {
710710
}
711711

712712
const char* static_value(const char* src) {
713-
return sequence< static_component,
713+
return sequence< sequence<
714+
static_component,
715+
zero_plus< identifier >
716+
>,
714717
zero_plus < sequence<
715718
alternatives<
716719
sequence< optional_spaces, alternatives<
@@ -722,6 +725,7 @@ namespace Sass {
722725
>,
723726
static_component
724727
> >,
728+
optional_css_whitespace,
725729
alternatives< exactly<';'>, exactly<'}'> >
726730
>(src);
727731
}

0 commit comments

Comments
 (0)