From 3f1f808b9eeb3f7cd923c6b89fbb57583202e76d Mon Sep 17 00:00:00 2001 From: Dustin Firebaugh Date: Sat, 8 Mar 2025 23:51:58 -0500 Subject: Full-file syntax highlighting for diff pages (#33766) Fix #33358, fix #21970 This adds a step in the `GitDiffForRender` that does syntax highlighting for the entire file and then only references lines from that syntax highlighted code. This allows things like multi-line comments to be syntax highlighted correctly. --------- Co-authored-by: wxiaoguang --- templates/repo/diff/image_diff.tmpl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'templates') diff --git a/templates/repo/diff/image_diff.tmpl b/templates/repo/diff/image_diff.tmpl index 608174e51b..bbd8d4a2ec 100644 --- a/templates/repo/diff/image_diff.tmpl +++ b/templates/repo/diff/image_diff.tmpl @@ -9,15 +9,15 @@ >
-
+
{{if .blobBase}} @@ -52,7 +52,7 @@
{{if and .blobBase .blobHead}} -
+
@@ -66,7 +66,7 @@
-
+
-- cgit v1.2.3