summaryrefslogtreecommitdiff
path: root/cgithub/views
diff options
context:
space:
mode:
Diffstat (limited to 'cgithub/views')
-rw-r--r--cgithub/views/blob.eta6
1 files changed, 4 insertions, 2 deletions
diff --git a/cgithub/views/blob.eta b/cgithub/views/blob.eta
index 444508e..be9a57e 100644
--- a/cgithub/views/blob.eta
+++ b/cgithub/views/blob.eta
@@ -22,9 +22,11 @@
<% } else if (it.htmlContent) { %>
<div class="box"><%~ it.htmlContent %></div>
<% } else if (it.htmlLines) { %>
- <pre class="box"><code><%~ it.htmlLines.join("\n") %></code></pre>
+ <pre class="box"><code><% for (const [i, line] of it.htmlLines.entries()) {
+ %><%= i ? "\n" : "" %><span id="L<%= i + 1 %>"><%~ line %></span><% } %></code></pre>
<% } else if (it.textLines) { %>
- <pre class="box"><code><%= it.textLines.join("\n") %></code></pre>
+ <pre class="box"><code><% for (const [i, line] of it.textLines.entries()) {
+ %><%= i ? "\n" : "" %><span id="L<%= i + 1 %>"><%= line %></span><% } %></code></pre>
<% } else { %>
<div class="box">This file cannot be displayed.</div>
<% } %>