mirror of
https://github.com/twbs/bootstrap.git
synced 2024-11-29 11:24:18 +01:00
parent
0d08c74d2f
commit
35d5cbf4fd
@ -52,9 +52,14 @@
|
|||||||
@function escape-svg($string) {
|
@function escape-svg($string) {
|
||||||
@if str-index($string, "data:image/svg+xml") {
|
@if str-index($string, "data:image/svg+xml") {
|
||||||
@each $char, $encoded in $escaped-characters {
|
@each $char, $encoded in $escaped-characters {
|
||||||
|
// 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);
|
$string: str-replace($string, $char, $encoded);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@return $string;
|
@return $string;
|
||||||
}
|
}
|
||||||
|
@ -106,6 +106,8 @@ $escaped-characters: (
|
|||||||
("<","%3c"),
|
("<","%3c"),
|
||||||
(">","%3e"),
|
(">","%3e"),
|
||||||
("#","%23"),
|
("#","%23"),
|
||||||
|
("(","%28"),
|
||||||
|
(")","%29"),
|
||||||
) !default;
|
) !default;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user