Skip to content

Commit 7b34072

Browse files
pgbovinemmmicedcoffee
authored andcommitted
put explicit newlines in strings
1 parent f8cdbe4 commit 7b34072

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎v3/js/pytutor.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2179,6 +2179,8 @@ ExecutionVisualizer.prototype.renderDataStructures = function() {
21792179
var literalStr = htmlspecialchars(obj);
21802180

21812181
// print as a double-quoted string literal
2182+
// with explicit newlines as <br/>
2183+
literalStr = literalStr.replace(new RegExp('\n', 'g'), '<br/>'); // replace ALL
21822184
literalStr = literalStr.replace(new RegExp('\"', 'g'), '\\"'); // replace ALL
21832185
literalStr = '"' + literalStr + '"';
21842186

0 commit comments

Comments
 (0)