Make the line numbers of the source code clickable
This commit is contained in:
parent
9f244dc97a
commit
739f74bb15
3 changed files with 49 additions and 8 deletions
|
@ -2249,9 +2249,9 @@ impl<'a> fmt::Show for Source<'a> {
|
|||
cols += 1;
|
||||
tmp /= 10;
|
||||
}
|
||||
try!(write!(fmt, "<pre class='line-numbers'>"));
|
||||
try!(write!(fmt, "<pre class=\"line-numbers\">"));
|
||||
for i in range(1, lines + 1) {
|
||||
try!(write!(fmt, "<span id='{0}'>{0:1$}</span>\n", i, cols));
|
||||
try!(write!(fmt, "<span id=\"{0}\">{0:1$}</span>\n", i, cols));
|
||||
}
|
||||
try!(write!(fmt, "</pre>"));
|
||||
try!(write!(fmt, "{}", highlight::highlight(s.as_slice(), None, None)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue