From db1d56b064920daaea5e26a131ba85e6a05d4909 Mon Sep 17 00:00:00 2001 From: Marcel Greter Date: Tue, 19 Jul 2016 19:20:43 +0200 Subject: [PATCH] Allow unicode chars in unquoted urls Fixes https://github.com/sass/libsass/issues/2120 --- src/lexer.cpp | 7 ++++--- src/parser.cpp | 4 ---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/lexer.cpp b/src/lexer.cpp index f9ae07c7c4..cb77cdbf42 100644 --- a/src/lexer.cpp +++ b/src/lexer.cpp @@ -88,11 +88,12 @@ namespace Sass { } // check if char is within a reduced ascii range - // valid in a uri (copied from Ruby Sass) + // valid in a uri (and also unicode octets) bool is_uri_character(const char& chr) { - return (unsigned(chr) > 41 && unsigned(chr) < 127) || - unsigned(chr) == ':' || unsigned(chr) == '/'; + return unsigned(chr) > 41 || + unsigned(chr) == ':' || + unsigned(chr) == '/'; } // check if char is within a reduced ascii range diff --git a/src/parser.cpp b/src/parser.cpp index 3e6bb225fb..c41d36e1c4 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -316,10 +316,6 @@ namespace Sass { else if (String* the_url = parse_url_function_argument()) { *args << SASS_MEMORY_NEW(ctx.mem, Argument, the_url->pstate(), the_url); } - else if (peek < skip_over_scopes < exactly < '(' >, exactly < ')' > > >(position)) { - Expression* the_url = parse_list(); // parse_interpolated_chunk(lexed); - *args << SASS_MEMORY_NEW(ctx.mem, Argument, the_url->pstate(), the_url); - } else { error("malformed URL", pstate); }