From 19a41aa644d3b51fd199378d79d8f1df1b3547a0 Mon Sep 17 00:00:00 2001 From: Martijn Cuppens Date: Sat, 14 Dec 2019 18:11:40 +0100 Subject: [PATCH 1/3] Escape brackets --- scss/_variables.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scss/_variables.scss b/scss/_variables.scss index 2fa04f6ce500..060757d12c52 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -208,6 +208,8 @@ $escaped-characters: ( ("<","%3c"), (">","%3e"), ("#","%23"), + ("(","%28"), + (")","%29"), ) !default; // Options From 7b4bb8c7036373c077557164ffc303a72e1faf70 Mon Sep 17 00:00:00 2001 From: Martijn Cuppens Date: Sat, 14 Dec 2019 19:32:41 +0100 Subject: [PATCH 2/3] Do not escape url brackets --- scss/_functions.scss | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scss/_functions.scss b/scss/_functions.scss index cc37c91f7286..a121ca0a4793 100644 --- a/scss/_functions.scss +++ b/scss/_functions.scss @@ -75,7 +75,13 @@ @function escape-svg($string) { @if str-index($string, "data:image/svg+xml") { @each $char, $encoded in $escaped-characters { - $string: str-replace($string, $char, $encoded); + // Do not escape the url brackets + @if str-index($string, "url(") == 1 { + $string: url("#{str-replace(str-slice($string, 6, -3), $char, $encoded)}"); + } + @else { + $string: str-replace($string, $char, $encoded); + } } } From 4940e88fada5df61a5960d48cb70bc2fea99627a Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Wed, 25 Dec 2019 22:24:13 +0200 Subject: [PATCH 3/3] Update _functions.scss --- scss/_functions.scss | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scss/_functions.scss b/scss/_functions.scss index a121ca0a4793..ad0e7a6679ed 100644 --- a/scss/_functions.scss +++ b/scss/_functions.scss @@ -78,8 +78,7 @@ // Do not escape the url brackets @if str-index($string, "url(") == 1 { $string: url("#{str-replace(str-slice($string, 6, -3), $char, $encoded)}"); - } - @else { + } @else { $string: str-replace($string, $char, $encoded); } }