mirror of https://github.com/twbs/bootstrap.git
parent
036a40c3dd
commit
5c37724d49
|
|
@ -75,7 +75,12 @@
|
||||||
@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 {
|
||||||
$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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -208,6 +208,8 @@ $escaped-characters: (
|
||||||
("<","%3c"),
|
("<","%3c"),
|
||||||
(">","%3e"),
|
(">","%3e"),
|
||||||
("#","%23"),
|
("#","%23"),
|
||||||
|
("(","%28"),
|
||||||
|
(")","%29"),
|
||||||
) !default;
|
) !default;
|
||||||
|
|
||||||
// Options
|
// Options
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue