From 62effe15b9941b38a649271480dba57bcdf1ec25 Mon Sep 17 00:00:00 2001 From: xzyfer Date: Fri, 30 Mar 2018 12:56:37 +1100 Subject: [PATCH] Fix regression in parsing selector with trailing escaped colon Fixes #2625 Spec https://github.com/sass/sass-spec/pull/1244 --- src/parser.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/parser.cpp b/src/parser.cpp index d0155dc03..dd6206217 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -2791,6 +2791,7 @@ namespace Sass { >(p) ) { bool could_be_property = peek< sequence< exactly<'-'>, exactly<'-'> > >(p) != 0; + bool could_be_escaped = false; while (p < q) { // did we have interpolations? if (*p == '#' && *(p+1) == '{') { @@ -2799,9 +2800,10 @@ namespace Sass { } // A property that's ambiguous with a nested selector is interpreted as a // custom property. - if (*p == ':') { + if (*p == ':' && !could_be_escaped) { rv.is_custom_property = could_be_property || p+1 == q || peek< space >(p+1); } + could_be_escaped = *p == '\\'; ++ p; } // store anyway }