Merge pull request #11054 from kim5566/techdoc/btoa-encoding
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-techdocs': patch
|
||||
---
|
||||
|
||||
Loading SVGs correctly with `bota` with extended characters
|
||||
@@ -69,7 +69,9 @@ export const addBaseUrl = ({
|
||||
const svgContent = await svg.text();
|
||||
elem.setAttribute(
|
||||
attributeName,
|
||||
`data:image/svg+xml;base64,${btoa(svgContent)}`,
|
||||
`data:image/svg+xml;base64,${btoa(
|
||||
unescape(encodeURIComponent(svgContent)),
|
||||
)}`,
|
||||
);
|
||||
} catch (e) {
|
||||
elem.setAttribute('alt', `Error: ${elemAttribute}`);
|
||||
|
||||
Reference in New Issue
Block a user