Show line breaks in score run and HTML tags in output

This commit is contained in:
Sebastian Serth
2021-02-06 13:34:11 +01:00
parent 5798f972f4
commit 4c7b5a5d23
2 changed files with 7 additions and 3 deletions

View File

@ -370,7 +370,8 @@ var CodeOceanEditor = {
},
initializeRegexes: function () {
this.regex_for_language.set("ace/mode/python", /File "(.+?)", line (\d+)/g);
// These RegEx are run on the HTML escaped output!
this.regex_for_language.set("ace/mode/python", /File "(.+?)", line (\d+)/g);
this.regex_for_language.set("ace/mode/java", /(.*\.java):(\d+):/g);
},
@ -467,7 +468,7 @@ var CodeOceanEditor = {
let errorMessagesToShow = [];
result.error_messages.forEach(function (item) {
if (item) {
errorMessagesToShow.push(item.replace(/\n/g, '<br>'))
errorMessagesToShow.push(item)
}
})
@ -605,7 +606,8 @@ var CodeOceanEditor = {
if (this.tracepositions_regex) {
$('#output>pre').each($.proxy(function(index, element) {
element = $(element)
const text = element.text();
debugger;
const text = _.escape(element.text());
element.on("click", "a", this.jumpToSourceLine.bind(this));
let matches;