Skip to content

Commit

Permalink
Fix for new escape sequences in nightly compiler.
Browse files Browse the repository at this point in the history
The current nightlies add the following:

* color+bold sequences
* unpaired "reset" before a color+bold sequence

Fixes: rust-lang#205
  • Loading branch information
birkenfeld committed May 9, 2016
1 parent 9777ef5 commit 756f6a5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions static/web.js
Original file line number Diff line number Diff line change
Expand Up @@ -543,11 +543,13 @@
return text.replace(/&/g, '&')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/\x1b\[3([0-7])m([^\x1b]*)(?:\x1b\(B)?\x1b\[0?m/g, function(original, colorCode, text) {
.replace(/\x1b\[1m\x1b\[3([0-7])m([^\x1b]*)(?:\x1b\(B)?\x1b\[0?m/g, function(original, colorCode, text) {
return '<span class=ansi-' + COLOR_CODES[+colorCode] + '><strong>' + text + '</strong></span>';
}).replace(/\x1b\[3([0-7])m([^\x1b]*)(?:\x1b\(B)?\x1b\[0?m/g, function(original, colorCode, text) {
return '<span class=ansi-' + COLOR_CODES[+colorCode] + '>' + text + '</span>';
}).replace(/\x1b\[1m([^\x1b]*)(?:\x1b\(B)?\x1b\[0?m/g, function(original, text) {
return "<strong>" + text + "</strong>";
});
}).replace(/(?:\x1b\(B)?\x1b\[0m/g, '');
}

//This affects how mouse acts on the program output.
Expand Down

0 comments on commit 756f6a5

Please sign in to comment.