Skip to content

Commit cfc0450

Browse files
authored
Remove old CodeMirrors when history load to fix #109 (#114)
1 parent 081bab7 commit cfc0450

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

templates/components/challenge_area.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@
6363
* @param {string} name - The name of the challenge.
6464
*/
6565
function renderCodeArea(code_under_test, test_code, level, name) {
66+
// delete old CodeMirrors to fix #109
67+
document.querySelectorAll('.CodeMirror').forEach(el => el.remove());
68+
6669
let confetti = new JSConfetti();
6770
let initTheme = localStorage.getItem('theme') === 'dark' ? "material-darker" : "default"
6871
let sharedCodeMirrorOptions = {

0 commit comments

Comments
 (0)