From 71442a856d2180c68a51a1db480514d611137bd0 Mon Sep 17 00:00:00 2001 From: Joe Mou Date: Wed, 28 Jan 2026 14:40:22 -0500 Subject: Syntax highlighting Sometimes GitHub returns colorizedLines and sometimes it returns a terser stylingDirectives, which needs to be applied to rawLines. --- cgithub/views/blob.eta | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cgithub/views') 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) { %>
<%~ it.htmlContent %>
+<% } else if (it.htmlLines) { %> +
<%~ it.htmlLines.join("\n") %>
<% } else { %> -
<%= it.rawLines.join("\n") %>
+
<%= it.textLines.join("\n") %>
<% } %> -- cgit v1.3.1