Skip to content

Commit a5d5b66

Browse files
committed
Encode data URI content for download links in /code
1 parent a1191bc commit a5d5b66

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

html/js/code.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ addEventListener("load", () => {
130130
if (/\.zip$/.test(exercise.file))
131131
link.href = exercise.file
132132
else
133-
link.href = "data:text/plain;charset=UTF-8," + exercise.solution
133+
link.href = "data:text/plain;charset=UTF-8," + encodeURIComponent(exercise.solution)
134134
}
135135
["box", "exercise"].forEach(id => {
136136
document.querySelector("#" + id + "_info").style.display =

0 commit comments

Comments
 (0)