Skip to content
This repository was archived by the owner on Jun 27, 2018. It is now read-only.

Commit 4bb5f6b

Browse files
committed
Open compiler explain links in a new window/tab
1 parent 1cb0cdb commit 4bb5f6b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

static/web.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,9 +586,9 @@
586586

587587
function formatCompilerOutput(text) {
588588
return ansi2html(text).replace(/\[(--explain )?(E\d\d\d\d)\]/g, function(text, prefix, code) {
589-
return "[<a href=https://doc.rust-lang.org/error-index.html#" + code + ">" + (prefix ? prefix : "") + code + "</a>]";
589+
return "[<a href=https://doc.rust-lang.org/error-index.html#" + code + " target=_new>" + (prefix ? prefix : "") + code + "</a>]";
590590
}).replace(/run `rustc --explain (E\d\d\d\d)` to see a detailed explanation/g, function(text, code) {
591-
return "see the <a href=https://doc.rust-lang.org/error-index.html#" + code + ">detailed explanation for " + code + "</a>";
591+
return "see the <a href=https://doc.rust-lang.org/error-index.html#" + code + " target=_new>detailed explanation for " + code + "</a>";
592592
}).replace(/&lt;anon&gt;:(\d+)$/mg, jumpToLine) // panicked at 'foo', $&
593593
.replace(/^&lt;anon&gt;:(\d+):(\d+):\s+(\d+):(\d+)/mg, jumpToRegion)
594594
.replace(/^&lt;anon&gt;:(\d+)/mg, jumpToLine)

0 commit comments

Comments
 (0)