diff options
| author | Joe Mou <dev@mou.fo> | 2026-01-28 14:40:22 -0500 |
|---|---|---|
| committer | Joe Mou <dev@mou.fo> | 2026-01-28 15:23:40 -0500 |
| commit | 71442a856d2180c68a51a1db480514d611137bd0 (patch) | |
| tree | 9352072449107902f4a5358da93f452e6825a2ec /cgithub/views/blob.eta | |
| parent | 89a771538a6a673de7cfe658b1db028acdfa0e44 (diff) | |
Syntax highlighting
Sometimes GitHub returns colorizedLines and sometimes it returns a
terser stylingDirectives, which needs to be applied to rawLines.
Diffstat (limited to 'cgithub/views/blob.eta')
| -rw-r--r-- | cgithub/views/blob.eta | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cgithub/views/blob.eta b/cgithub/views/blob.eta index 346afab..4972209 100644 --- a/cgithub/views/blob.eta +++ b/cgithub/views/blob.eta @@ -14,6 +14,8 @@ <% if (it.htmlContent) { %> <div class="box"><%~ it.htmlContent %></div> +<% } else if (it.htmlLines) { %> + <pre class="box"><code><%~ it.htmlLines.join("\n") %></code></pre> <% } else { %> - <pre class="box"><code><%= it.rawLines.join("\n") %></code></pre> + <pre class="box"><code><%= it.textLines.join("\n") %></code></pre> <% } %> |
