From 35d5cbf4fda4bfad4c244840824774bb94629212 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 695e6cd2f8d7..ea02aa48cada 100644 --- a/scss/_functions.scss +++ b/scss/_functions.scss @@ -52,7 +52,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 5d3135cd95f0..a85f43ceba0e 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -106,6 +106,8 @@ $escaped-characters: ( ("<","%3c"), (">","%3e"), ("#","%23"), + ("(","%28"), + (")","%29"), ) !default;