Skip to content

Commit

Permalink
Fix encoding of download colored SVGs (#342)
Browse files Browse the repository at this point in the history
  • Loading branch information
LitoMore authored Sep 24, 2024
1 parent 243ea66 commit 2f9a48f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions public/scripts/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,14 @@ export default function modal(document, domUtils) {
.then((iconSVG) => {
const coloredIconSVG = iconSVG.replace(
'svg',
`svg fill="%23${iconCssHex.replace('#', '')}"`,
`svg fill="${iconCssHex}"`,
);
const $iconDownloadColorSVG = $detailFooter.querySelector(
'#icon-download-color-svg',
);
$iconDownloadColorSVG.setAttribute(
'href',
`data:image/svg+xml,${coloredIconSVG}`,
`data:image/svg+xml,${encodeURIComponent(coloredIconSVG)}`,
);
$iconDownloadColorSVG.setAttribute('download', `${iconSlug}-color.svg`);
});
Expand Down

0 comments on commit 2f9a48f

Please sign in to comment.