From e8461b57674b9c4e6ed93151d06dbc6149703178 Mon Sep 17 00:00:00 2001 From: Joe Mou Date: Wed, 12 Aug 2026 01:38:24 -0400 Subject: Handle blobs GitHub cannot preview Binary files with no preview (a .ttf, say) have no rawLines, no colorizedLines and no richText, so the blob view's final branch threw on a null textLines and the page 500ed. Offer the raw file instead. Co-Authored-By: Claude Opus 5 --- cgithub/views/blob.eta | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cgithub/views') diff --git a/cgithub/views/blob.eta b/cgithub/views/blob.eta index ed1e84b..c7315f6 100644 --- a/cgithub/views/blob.eta +++ b/cgithub/views/blob.eta @@ -8,7 +8,7 @@ <% } %>
<%= it.size %>
- Raw + View raw
@@ -18,6 +18,8 @@
<%~ it.htmlContent %>
<% } else if (it.htmlLines) { %>
<%~ it.htmlLines.join("\n") %>
-<% } else { %> +<% } else if (it.textLines) { %>
<%= it.textLines.join("\n") %>
+<% } else { %> +
This file cannot be displayed
<% } %> -- cgit v1.3.1