Skip to content

Commit

Permalink
Fix error when showing some special svg due to data url
Browse files Browse the repository at this point in the history
  • Loading branch information
cesaryuan committed Sep 9, 2024
1 parent 1e1a144 commit f9af6dc
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/js/page/ui/svg-output.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ export default class SvgOutput {
}

setSvg({ text, width, height }) {
// TODO: revisit this
// I would rather use blob urls, but they don't work in Firefox
// All the internal refs break.
// https://bugzilla.mozilla.org/show_bug.cgi?id=1125667
const nextLoad = this._nextLoadPromise();
this._svgFrame.src = `data:image/svg+xml,${encodeURIComponent(text)}`;
this._svgFrame.src = URL.createObjectURL(
new Blob([text], { type: 'image/svg+xml' }),
)

Check failure on line 29 in src/js/page/ui/svg-output.js

View workflow job for this annotation

GitHub Actions / Lint

Insert `;`
this._svgFrame.style.width = `${width}px`;
this._svgFrame.style.height = `${height}px`;
return nextLoad;
Expand Down

0 comments on commit f9af6dc

Please sign in to comment.