1
Fork 0

Make the line numbers of the source code clickable

This commit is contained in:
Barosl Lee 2014-12-20 03:56:47 +09:00
parent 9f244dc97a
commit 739f74bb15
3 changed files with 49 additions and 8 deletions

View file

@ -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)));