Skip to content

Commit 0e89a87

Browse files
committed
Merge pull request #1868 from mgreter/feature/url-suffix-fn-parsing
Improve url parsing for functions with suffixes
2 parents 146a334 + 7a14b2e commit 0e89a87

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

src/constants.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ namespace Sass {
7979
extern const char keyframes_kwd[] = "keyframes";
8080
extern const char only_kwd[] = "only";
8181
extern const char rgb_kwd[] = "rgb(";
82-
extern const char url_kwd[] = "url(";
82+
extern const char url_kwd[] = "url";
8383
// extern const char url_prefix_kwd[] = "url-prefix(";
8484
extern const char important_kwd[] = "important";
8585
extern const char pseudo_not_kwd[] = ":not(";

src/constants.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ namespace Sass {
8181
extern const char rgb_kwd[];
8282
extern const char url_kwd[];
8383
// extern const char url_prefix_kwd[];
84-
extern const char image_url_kwd[];
8584
extern const char important_kwd[];
8685
extern const char pseudo_not_kwd[];
8786
extern const char even_kwd[];

src/prelexer.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,20 @@ namespace Sass {
642642
// Match CSS uri specifiers.
643643

644644
const char* uri_prefix(const char* src) {
645-
return exactly<url_kwd>(src);
645+
return sequence <
646+
exactly <
647+
url_kwd
648+
>,
649+
zero_plus <
650+
sequence <
651+
exactly <'-'>,
652+
one_plus <
653+
alpha
654+
>
655+
>
656+
>,
657+
exactly <'('>
658+
>(src);
646659
}
647660

648661
// TODO: rename the following two functions

0 commit comments

Comments
 (0)