all repos — elgit @ bf524d485c6d426adbe8f3717664411d7cbdbaef

fork of legit: web frontend for git, written in go

templates/commit: Replace <p> in <pre> with <span>

<p> is a block-level element, and is invalid in <pre>.
Runxi Yu me@runxiyu.org
Sat, 15 Feb 2025 18:48:13 +0800
commit

bf524d485c6d426adbe8f3717664411d7cbdbaef

parent

b16202cd5ca129d141e1b6e3ff5e0eda50bdb990

2 files changed, 2 insertions(+), 3 deletions(-)

jump to
M config.yamlconfig.yaml
@@ -1,5 +1,5 @@ repo:
-  scanPath: /var/www/git
+  scanPath: /tmp/git
   readme:
     - readme
     - README
M templates/commit.htmltemplates/commit.html
@@ -78,9 +78,8 @@ {{- end -}}           {{ if .IsBinary }}
           <p>Not showing binary file.</p>
           {{ else }}
-            <pre>
+            <pre><span style="display: block">{{- .Header -}}</span>
             {{- range .TextFragments -}}
-            <p>{{- .Header -}}</p>
             {{- range .Lines -}}
               {{- if eq .Op.String "+" -}}
               <span class="diff-add">{{ .String }}</span>