Skip to content

Commit 5ff5859

Browse files
committed
Fix regression in parsing selector with trailing escaped colon
Fixes #2625 Spec sass/sass-spec#1244
1 parent 0e6d8a6 commit 5ff5859

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/parser.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2791,6 +2791,7 @@ namespace Sass {
27912791
>(p)
27922792
) {
27932793
bool could_be_property = peek< sequence< exactly<'-'>, exactly<'-'> > >(p) != 0;
2794+
bool could_be_escaped = false;
27942795
while (p < q) {
27952796
// did we have interpolations?
27962797
if (*p == '#' && *(p+1) == '{') {
@@ -2799,9 +2800,10 @@ namespace Sass {
27992800
}
28002801
// A property that's ambiguous with a nested selector is interpreted as a
28012802
// custom property.
2802-
if (*p == ':') {
2803+
if (*p == ':' && !could_be_escaped) {
28032804
rv.is_custom_property = could_be_property || p+1 == q || peek< space >(p+1);
28042805
}
2806+
could_be_escaped = *p == '\\';
28052807
++ p;
28062808
}
28072809
// store anyway }

0 commit comments

Comments
 (0)