From 774614b4d5442a5061c1e3854d388f2d4dd61fd5 Mon Sep 17 00:00:00 2001 From: Martijn Cuppens Date: Wed, 25 Dec 2019 21:43:22 +0100 Subject: [PATCH] Escape brackets (#29857) Co-authored-by: XhmikosR --- scss/_functions.scss | 7 ++++++- scss/_variables.scss | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/scss/_functions.scss b/scss/_functions.scss index cc37c91f7286..ad0e7a6679ed 100644 --- a/scss/_functions.scss +++ b/scss/_functions.scss @@ -75,7 +75,12 @@ @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); + } } } diff --git a/scss/_variables.scss b/scss/_variables.scss index c34e2d1700ae..ef0f2125db14 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -208,6 +208,8 @@ $escaped-characters: ( ("<","%3c"), (">","%3e"), ("#","%23"), + ("(","%28"), + (")","%29"), ) !default; // Options