From 05769273d9bef49a60a9af337ddfe99e5e393bca Mon Sep 17 00:00:00 2001 From: Marcel Greter Date: Sun, 25 Dec 2016 22:41:23 +0100 Subject: [PATCH] Fix parsing of url with quoted argument Fixes https://github.com/sass/libsass/issues/2243 --- src/prelexer.cpp | 23 +++++++++++++---------- src/sass2scss.cpp | 3 ++- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/prelexer.cpp b/src/prelexer.cpp index 269feec516..cab812bba1 100644 --- a/src/prelexer.cpp +++ b/src/prelexer.cpp @@ -243,16 +243,19 @@ namespace Sass { exactly <'l'>, exactly <'('>, W, - non_greedy< - alternatives< - class_char< real_uri_chars >, - uri_character, - NONASCII, - ESCAPE - >, - alternatives< - sequence < W, exactly <')'> >, - exactly< hash_lbrace > + alternatives< + quoted_string, + non_greedy< + alternatives< + class_char< real_uri_chars >, + uri_character, + NONASCII, + ESCAPE + >, + alternatives< + sequence < W, exactly <')'> >, + exactly< hash_lbrace > + > > > >(src); diff --git a/src/sass2scss.cpp b/src/sass2scss.cpp index 705f9b2fe1..56333b38ea 100644 --- a/src/sass2scss.cpp +++ b/src/sass2scss.cpp @@ -587,7 +587,8 @@ namespace Sass sass.substr(pos_left, 5) == "@warn" || sass.substr(pos_left, 6) == "@debug" || sass.substr(pos_left, 6) == "@error" || - sass.substr(pos_left, 8) == "@charset" + sass.substr(pos_left, 8) == "@charset" || + sass.substr(pos_left, 10) == "@namespace" ) { sass = indent + sass.substr(pos_left); } // replace some specific sass shorthand directives (if not fallowed by a white space character) else if (sass.substr(pos_left, 1) == "=")