Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 84a6223

Browse files
committed
Add: check for data-filename
1 parent f3d1a2a commit 84a6223

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

runestone/activecode/js/activecode.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,12 @@ Yet another is that there is an internal error. The internal error message is:
10221022
return Sk.builtinFiles["files"][x];
10231023
}
10241024
fileReader(divid) {
1025+
// In the beginning files were just pre tags and we used the divid as the filename
10251026
let elem = document.getElementById(divid);
1027+
// In PreTeXt we moved that to a @data-filename
1028+
if (elem === null) {
1029+
elem = document.querySelector(`[data-filename="${divid}"]`);
1030+
}
10261031
let data = "";
10271032
let result = "";
10281033
if (elem == null && Sk.builtinFiles.files.hasOwnProperty(divid)) {

0 commit comments

Comments
 (0)