From ca23e43e0e95014ddd5f8d5e02e1118f5e2978f5 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 --- views/blob.eta | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'views') diff --git a/views/blob.eta b/views/blob.eta index ed1e84b..c7315f6 100644 --- a/views/blob.eta +++ b/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