diff --git a/app/assets/javascripts/editor/editor.js.erb b/app/assets/javascripts/editor/editor.js.erb
index 2af1c3a7..4437d88a 100644
--- a/app/assets/javascripts/editor/editor.js.erb
+++ b/app/assets/javascripts/editor/editor.js.erb
@@ -652,12 +652,17 @@ var CodeOceanEditor = {
let matches;
- let augmented_text = text;
+ // Switch both lines below to enable the output of images and render
tags.
+ // Also consider `printOutput` in evaluation.js
+
+ // let augmented_text = element.text();
+ let augmented_text = element.html();
while (matches = this.tracepositions_regex.exec(text)) {
const frame = $('div.frame[data-filename="' + matches[1] + '"]')
if (frame.length > 0) {
- augmented_text = augmented_text.replace(new RegExp(matches[0], 'g'), "" + matches[0] + "");
+ // augmented_text = augmented_text.replace(new RegExp(matches[0], 'g'), "" + matches[0] + "");
+ augmented_text = augmented_text.replace(new RegExp(_.unescape(matches[0]), 'g'), "" + matches[0] + "");
}
}
element.html(augmented_text);
diff --git a/app/assets/javascripts/editor/evaluation.js b/app/assets/javascripts/editor/evaluation.js
index 922ba63d..6fbec44a 100644
--- a/app/assets/javascripts/editor/evaluation.js
+++ b/app/assets/javascripts/editor/evaluation.js
@@ -212,7 +212,8 @@ CodeOceanEditorEvaluation = {
}
var element = this.findOrCreateOutputElement(index);
- // Switch all four lines below to enable the output of images and render
tags
+ // Switch all four lines below to enable the output of images and render
tags.
+ // Also consider `augmentStacktraceInOutput` in editor.js.erb
if (!colorize) {
if (output.stdout !== undefined && output.stdout !== '') {
output.stdout = output.stdout.replace(this.nonPrintableRegEx, "")