Skip to content

Commit f9af6dc

Browse files
committed
Fix error when showing some special svg due to data url
1 parent 1e1a144 commit f9af6dc

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Diff for: src/js/page/ui/svg-output.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@ export default class SvgOutput {
2323
}
2424

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

0 commit comments

Comments
 (0)